Clarify readme and fix filtering with transformers

This commit is contained in:
AuroraWright
2024-06-26 07:33:01 +02:00
parent 6b9b5c9351
commit cf3df01ee8
2 changed files with 3 additions and 3 deletions

View File

@@ -294,8 +294,8 @@ class TextFiltering:
if self.accurate_filtering:
detection_results = self.pipe(new_blocks, top_k=2, truncation=True)
for idx, block in enumerate(new_blocks):
if((detection_results[idx][0]['label'] == 'ja' and detection_results[idx][0]['score'] >= 0.85) or
(detection_results[idx][1]['label'] == 'ja' and detection_results[idx][1]['score'] >= 0.85)):
if((detection_results[idx][0]['label'] == 'ja' and detection_results[idx][0]['score'] >= 0.20) or
(detection_results[idx][1]['label'] == 'ja' and detection_results[idx][1]['score'] >= 0.20)):
final_blocks.append(block)
else:
for block in new_blocks: