Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -25,9 +25,15 @@ import gradio as gr
|
|
25 |
from simpletransformers.ner import NERModel
|
26 |
import string
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
def ner(text):
|
30 |
-
model = NERModel("albert", "bgk/lodosalberttr",ignore_mismatched_sizes=True,use_cuda=False)
|
31 |
trans_table = text.maketrans('', '', string.punctuation)
|
32 |
text = text.translate(trans_table)
|
33 |
|
|
|
25 |
from simpletransformers.ner import NERModel
|
26 |
import string
|
27 |
|
28 |
+
labels = ["B-YEMEK","O","B-ICECEK_BUYUKLUK","B-ICECEK","B-ADRES","B-ODEME","B-YEMEK_CESIT","B-YEMEK_ADET","B-ICECEK_ICERIK","I-ADRES","I-YEMEK","B-YEMEK_BUYUKLUK","B-YEMEK_ICERIK","I-YEMEK_ICERIK","I-ICECEK","I-YEMEK_BUYUKLUK","I-YEMEK_CESIT","B-ICECEK_ADET","I-ODEME","I-YEMEK_ADET"]
|
29 |
+
model = NERModel(
|
30 |
+
"albert",
|
31 |
+
"bgk/lodosalberttr", labels=labels,
|
32 |
+
use_cuda=False,
|
33 |
+
ignore_mismatched_sizes=True
|
34 |
+
)
|
35 |
|
36 |
def ner(text):
|
|
|
37 |
trans_table = text.maketrans('', '', string.punctuation)
|
38 |
text = text.translate(trans_table)
|
39 |
|