KoichiYasuoka
commited on
Commit
•
ca785c7
1
Parent(s):
03c157b
token-classification pipeline
Browse files- config.json +8 -0
- upos.py +4 -0
config.json
CHANGED
@@ -11,6 +11,14 @@
|
|
11 |
"upos": {
|
12 |
"impl": "upos.BellmanFordTokenClassificationPipeline",
|
13 |
"pt": "AutoModelForTokenClassification"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
},
|
16 |
"eos_token_id": 151643,
|
|
|
11 |
"upos": {
|
12 |
"impl": "upos.BellmanFordTokenClassificationPipeline",
|
13 |
"pt": "AutoModelForTokenClassification"
|
14 |
+
},
|
15 |
+
"token-classification": {
|
16 |
+
"impl": "upos.RawTokenClassificationPipeline",
|
17 |
+
"pt": "AutoModelForTokenClassification"
|
18 |
+
},
|
19 |
+
"ner": {
|
20 |
+
"impl": "upos.RawTokenClassificationPipeline",
|
21 |
+
"pt": "AutoModelForTokenClassification"
|
22 |
}
|
23 |
},
|
24 |
"eos_token_id": 151643,
|
upos.py
CHANGED
@@ -40,6 +40,10 @@ class BellmanFordTokenClassificationPipeline(TokenClassificationPipeline):
|
|
40 |
t["text"]=model_outputs["sentence"][t["start"]:t["end"]]
|
41 |
return w
|
42 |
|
|
|
|
|
|
|
|
|
43 |
class Qwen2ForTokenClassification(Qwen2PreTrainedModel):
|
44 |
def __init__(self,config):
|
45 |
from torch import nn
|
|
|
40 |
t["text"]=model_outputs["sentence"][t["start"]:t["end"]]
|
41 |
return w
|
42 |
|
43 |
+
class RawTokenClassificationPipeline(TokenClassificationPipeline):
|
44 |
+
def check_model_type(self,supported_models):
|
45 |
+
pass
|
46 |
+
|
47 |
class Qwen2ForTokenClassification(Qwen2PreTrainedModel):
|
48 |
def __init__(self,config):
|
49 |
from torch import nn
|