Spaces:
Sleeping
Sleeping
Update code
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio
|
| 2 |
-
from transformers import
|
| 3 |
|
| 4 |
def merge_split_token(tokens):
|
| 5 |
merged = []
|
|
@@ -11,7 +11,7 @@ def merge_split_token(tokens):
|
|
| 11 |
|
| 12 |
return merged
|
| 13 |
def process_trans_text(text):
|
| 14 |
-
nlp=
|
| 15 |
nlp_results = nlp(text)
|
| 16 |
print('nlp_results:', nlp_results)
|
| 17 |
|
|
|
|
| 1 |
import gradio
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
def merge_split_token(tokens):
|
| 5 |
merged = []
|
|
|
|
| 11 |
|
| 12 |
return merged
|
| 13 |
def process_trans_text(text):
|
| 14 |
+
nlp=pipeline("ner", model='KBLab/bert-base-swedish-cased-ner', tokenizer='KBLab/bert-base-swedish-cased-ner')
|
| 15 |
nlp_results = nlp(text)
|
| 16 |
print('nlp_results:', nlp_results)
|
| 17 |
|