Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,6 @@ import re
|
|
8 |
import os
|
9 |
from transformers import pipeline
|
10 |
|
11 |
-
@spaces.GPU
|
12 |
pipe = pipeline("text-generation", model="jslin09/gemma2-2b-ner", device="cuda")
|
13 |
|
14 |
elements = {'LEO_SOC': ('犯罪主體', 'Subject of Crime'),
|
@@ -134,6 +133,7 @@ def tag_in_color(tag_content, tag):
|
|
134 |
# print(parts)
|
135 |
return parts
|
136 |
|
|
|
137 |
def le_tagger(content, tag):
|
138 |
jaccard_score = [] # 紀錄單篇的分數
|
139 |
score = ()
|
|
|
8 |
import os
|
9 |
from transformers import pipeline
|
10 |
|
|
|
11 |
pipe = pipeline("text-generation", model="jslin09/gemma2-2b-ner", device="cuda")
|
12 |
|
13 |
elements = {'LEO_SOC': ('犯罪主體', 'Subject of Crime'),
|
|
|
133 |
# print(parts)
|
134 |
return parts
|
135 |
|
136 |
+
@spaces.GPU
|
137 |
def le_tagger(content, tag):
|
138 |
jaccard_score = [] # 紀錄單篇的分數
|
139 |
score = ()
|