openfree commited on
Commit
b0a9a13
ยท
verified ยท
1 Parent(s): 7cd383c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -184,6 +184,18 @@ class ContentDeduplicator:
184
  def get_used_elements(self) -> List[str]:
185
  """์‚ฌ์šฉ๋œ ํ•ต์‹ฌ ์š”์†Œ ๋ฐ˜ํ™˜"""
186
  return list(self.seen_key_phrases)[:10] # ์ตœ๊ทผ 10๊ฐœ
 
 
 
 
 
 
 
 
 
 
 
 
187
 
188
 
189
  class ProgressionMonitor:
 
184
  def get_used_elements(self) -> List[str]:
185
  """์‚ฌ์šฉ๋œ ํ•ต์‹ฌ ์š”์†Œ ๋ฐ˜ํ™˜"""
186
  return list(self.seen_key_phrases)[:10] # ์ตœ๊ทผ 10๊ฐœ
187
+
188
+ def count_repetitions(self, content: str) -> int:
189
+ """ํ…์ŠคํŠธ ๋‚ด์˜ ๋ฐ˜๋ณต ํšŸ์ˆ˜ ๊ณ„์‚ฐ"""
190
+ paragraphs = content.split('\n\n')
191
+ repetitions = 0
192
+
193
+ for i, para1 in enumerate(paragraphs):
194
+ for para2 in paragraphs[i+1:]:
195
+ if self.check_similarity(para1, para2) > 0.7:
196
+ repetitions += 1
197
+
198
+ return repetitions
199
 
200
 
201
  class ProgressionMonitor: