Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -86,9 +86,7 @@ def evaluate_one_preamble(model, sentence):
|
|
86 |
|
87 |
predictions = logits_clean.argmax(dim=1).tolist()
|
88 |
prediction_label = [ids_to_labels_preamble[i] for i in predictions]
|
89 |
-
|
90 |
-
print(len(prediction_label))
|
91 |
-
print(prediction_label)
|
92 |
return (prediction_label,text)
|
93 |
|
94 |
def evaluate_one_text(model, sentence):
|
@@ -105,9 +103,7 @@ def evaluate_one_text(model, sentence):
|
|
105 |
|
106 |
predictions = logits_clean.argmax(dim=1).tolist()
|
107 |
prediction_label = [ids_to_labels_judgment[i] for i in predictions]
|
108 |
-
|
109 |
-
print(len(prediction_label))
|
110 |
-
print(prediction_label)
|
111 |
return (prediction_label,text)
|
112 |
|
113 |
def cleanhtml(raw_html):
|
@@ -206,14 +202,7 @@ def judgtext_analysis(text):
|
|
206 |
i=0
|
207 |
finallistshortened=[]
|
208 |
labellistshortened=[]
|
209 |
-
|
210 |
-
# print("Unmatching sentence: " + sentence)
|
211 |
-
# if(len(labellist) < len(finallist)):
|
212 |
-
# while(len(labellist) < len(finallist)):
|
213 |
-
# labellist.append("O")
|
214 |
-
# if(len(labellist) > len(finallist)):
|
215 |
-
# while(len(labellist) > len(finallist)):
|
216 |
-
# finallist.append("O")
|
217 |
while(i<len(finallist)):
|
218 |
word=""
|
219 |
word+=finallist[i]
|
|
|
86 |
|
87 |
predictions = logits_clean.argmax(dim=1).tolist()
|
88 |
prediction_label = [ids_to_labels_preamble[i] for i in predictions]
|
89 |
+
|
|
|
|
|
90 |
return (prediction_label,text)
|
91 |
|
92 |
def evaluate_one_text(model, sentence):
|
|
|
103 |
|
104 |
predictions = logits_clean.argmax(dim=1).tolist()
|
105 |
prediction_label = [ids_to_labels_judgment[i] for i in predictions]
|
106 |
+
|
|
|
|
|
107 |
return (prediction_label,text)
|
108 |
|
109 |
def cleanhtml(raw_html):
|
|
|
202 |
i=0
|
203 |
finallistshortened=[]
|
204 |
labellistshortened=[]
|
205 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
while(i<len(finallist)):
|
207 |
word=""
|
208 |
word+=finallist[i]
|