Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ if tags:
|
|
67 |
for tag,embedding in zip(tags,pools_tags):
|
68 |
token_dict[tag] = embedding
|
69 |
|
70 |
-
|
71 |
|
72 |
def concat_tokens(sentences):
|
73 |
tokens = {'input_ids': [], 'attention_mask': [], 'KPS': {}}
|
@@ -116,7 +116,7 @@ def extract_tokens(text,top_kp=30):
|
|
116 |
kps = {x:y for x,y in kps}
|
117 |
return concat_tokens(kps)
|
118 |
|
119 |
-
|
120 |
if text and tags:
|
121 |
text = text.lower()
|
122 |
t1_tokens = extract_tokens(text)
|
|
|
67 |
for tag,embedding in zip(tags,pools_tags):
|
68 |
token_dict[tag] = embedding
|
69 |
|
70 |
+
#Code related with processing text, extracting KPs, and doing distance to tag
|
71 |
|
72 |
def concat_tokens(sentences):
|
73 |
tokens = {'input_ids': [], 'attention_mask': [], 'KPS': {}}
|
|
|
116 |
kps = {x:y for x,y in kps}
|
117 |
return concat_tokens(kps)
|
118 |
|
119 |
+
#Process text and classify it
|
120 |
if text and tags:
|
121 |
text = text.lower()
|
122 |
t1_tokens = extract_tokens(text)
|