Spaces:
Runtime error
Runtime error
add sentence boundary
Browse files- code/prediction.py +1 -1
code/prediction.py
CHANGED
@@ -66,7 +66,7 @@ def test_predict(test_loader, device, model, min_label=1, max_label=3):
|
|
66 |
model.train()
|
67 |
return result
|
68 |
|
69 |
-
def add_sentence_table(result, pattern ="
|
70 |
for sample in result:
|
71 |
boundary_list = []
|
72 |
for i, char in enumerate(sample['text_a']):
|
|
|
66 |
model.train()
|
67 |
return result
|
68 |
|
69 |
+
def add_sentence_table(result, pattern =":;。,,?!~!: ", threshold_num=5, threshold_rate=0.5):
|
70 |
for sample in result:
|
71 |
boundary_list = []
|
72 |
for i, char in enumerate(sample['text_a']):
|