Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
14 |
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
15 |
|
16 |
# สร้าง pipeline สำหรับ NER
|
17 |
-
ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer
|
18 |
|
19 |
# UI ด้วย Streamlit
|
20 |
st.title("NER Analysis with Nucha SkillNER BERT and Spark NLP Display")
|
@@ -22,7 +22,8 @@ st.title("NER Analysis with Nucha SkillNER BERT and Spark NLP Display")
|
|
22 |
text = st.text_area("Enter text for NER analysis:")
|
23 |
|
24 |
if st.button("Analyze"):
|
25 |
-
|
|
|
26 |
|
27 |
# สร้าง DataFrame สำหรับผลลัพธ์
|
28 |
data = [{"word": entity['word'], "start": entity['start'], "end": entity['end'], "label": entity['entity']} for entity in ner_results]
|
|
|
14 |
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
15 |
|
16 |
# สร้าง pipeline สำหรับ NER
|
17 |
+
ner_pipeline = pipeline("ner", model=model, tokenizer=tokenizer)
|
18 |
|
19 |
# UI ด้วย Streamlit
|
20 |
st.title("NER Analysis with Nucha SkillNER BERT and Spark NLP Display")
|
|
|
22 |
text = st.text_area("Enter text for NER analysis:")
|
23 |
|
24 |
if st.button("Analyze"):
|
25 |
+
# สร้าง pipeline สำหรับ NER
|
26 |
+
ner_results = pipeline("ner", model=model, tokenizer=tokenizer)
|
27 |
|
28 |
# สร้าง DataFrame สำหรับผลลัพธ์
|
29 |
data = [{"word": entity['word'], "start": entity['start'], "end": entity['end'], "label": entity['entity']} for entity in ner_results]
|