Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
import transformers
|
| 3 |
from transformers import pipeline, TokenClassificationPipeline, BertForTokenClassification , AutoTokenizer , TextClassificationPipeline , AutoModelForSequenceClassification
|
| 4 |
|
|
@@ -204,10 +205,12 @@ edccan = []
|
|
| 204 |
for i in range(len(outrelbl)):
|
| 205 |
if outrelbl[i]== "other":
|
| 206 |
edccan += [[lstSentEnc[i],lstSentEnt[i][0], lstSentEnt[i][1],lstSentbilbl[i][0]+" "+outrelbl[i][:-7]+" "+lstSentbilbl[i][1]]]
|
|
|
|
|
|
|
| 207 |
|
| 208 |
if x:
|
| 209 |
out = token_classifier(x)
|
| 210 |
-
st.
|
| 211 |
|
| 212 |
|
| 213 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
import transformers
|
| 4 |
from transformers import pipeline, TokenClassificationPipeline, BertForTokenClassification , AutoTokenizer , TextClassificationPipeline , AutoModelForSequenceClassification
|
| 5 |
|
|
|
|
| 205 |
for i in range(len(outrelbl)):
|
| 206 |
if outrelbl[i]== "other":
|
| 207 |
edccan += [[lstSentEnc[i],lstSentEnt[i][0], lstSentEnt[i][1],lstSentbilbl[i][0]+" "+outrelbl[i][:-7]+" "+lstSentbilbl[i][1]]]
|
| 208 |
+
|
| 209 |
+
edccandf = pd.DataFrame(edccan, columns= ["Sentence", "Entity 1", "Entity 2", "Relation"] )
|
| 210 |
|
| 211 |
if x:
|
| 212 |
out = token_classifier(x)
|
| 213 |
+
st.table(edccandf)
|
| 214 |
|
| 215 |
|
| 216 |
|