Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -150,13 +150,14 @@ def main():
|
|
| 150 |
|
| 151 |
model = DistilBertForTokenClassification.from_pretrained(model_path1) #len(unique_tags),, num_labels= 7, , id2label={0:'CT',1:'E',2:'C',3:'O'}
|
| 152 |
pipe = pipeline('ner', model=model, tokenizer=tokenizer,aggregation_strategy='simple') #grouped_entities=True
|
| 153 |
-
|
| 154 |
sentence_pred = []
|
| 155 |
class_list = []
|
| 156 |
entity_list = []
|
| 157 |
for k in causal_sents:
|
| 158 |
pred= pipe(k)
|
| 159 |
#st.write(pred)
|
|
|
|
| 160 |
for i in pred:
|
| 161 |
|
| 162 |
sentence_pred.append(k)
|
|
|
|
| 150 |
|
| 151 |
model = DistilBertForTokenClassification.from_pretrained(model_path1) #len(unique_tags),, num_labels= 7, , id2label={0:'CT',1:'E',2:'C',3:'O'}
|
| 152 |
pipe = pipeline('ner', model=model, tokenizer=tokenizer,aggregation_strategy='simple') #grouped_entities=True
|
| 153 |
+
st.write('DistilBERT loaded')
|
| 154 |
sentence_pred = []
|
| 155 |
class_list = []
|
| 156 |
entity_list = []
|
| 157 |
for k in causal_sents:
|
| 158 |
pred= pipe(k)
|
| 159 |
#st.write(pred)
|
| 160 |
+
st.write('preds')
|
| 161 |
for i in pred:
|
| 162 |
|
| 163 |
sentence_pred.append(k)
|