Update human_text_detect.py
Browse files- human_text_detect.py +2 -2
human_text_detect.py
CHANGED
|
@@ -79,7 +79,7 @@ def get_threshold_obj(model_name, topic):
|
|
| 79 |
|
| 80 |
return threshold
|
| 81 |
|
| 82 |
-
def detect_human_text(model_name, topic, text):
|
| 83 |
|
| 84 |
torch.cuda.empty_cache()
|
| 85 |
gc.collect()
|
|
@@ -157,7 +157,7 @@ def detect_human_text(model_name, topic, text):
|
|
| 157 |
|
| 158 |
results = res['HC']
|
| 159 |
|
| 160 |
-
threshold = get_threshold_obj(model_name, topic)
|
| 161 |
print(f"threshold: {threshold}, results: {results}")
|
| 162 |
return round((results / threshold) - 1, 2), round(results, 2), res['sentences']
|
| 163 |
|
|
|
|
| 79 |
|
| 80 |
return threshold
|
| 81 |
|
| 82 |
+
def detect_human_text(model_name, topic, threshold, text):
|
| 83 |
|
| 84 |
torch.cuda.empty_cache()
|
| 85 |
gc.collect()
|
|
|
|
| 157 |
|
| 158 |
results = res['HC']
|
| 159 |
|
| 160 |
+
# threshold = get_threshold_obj(model_name, topic)
|
| 161 |
print(f"threshold: {threshold}, results: {results}")
|
| 162 |
return round((results / threshold) - 1, 2), round(results, 2), res['sentences']
|
| 163 |
|