ctlin commited on
Commit
7b5f4fe
·
1 Parent(s): 664fc70
Files changed (1) hide show
  1. README.md +34 -3
README.md CHANGED
@@ -36,14 +36,45 @@ The copyright of the datasets belongs to the Institute of Linguistics, Academia
36
  AutoModel,
37
  )
38
 
39
- tokenizer = AutoTokenizer.from_pretrained("ckiplab/oldhan-bert-base-chinese-ws")
40
- model = AutoModel.from_pretrained("ckiplab/oldhan-bert-base-chinese-ws")
41
  ```
42
 
43
  * Using our model for inference
44
  ```python
45
  >>> from transformers import pipeline
46
- >>> classifier = pipeline("token-classification", model="ckiplab/oldhan-bert-base-chinese-ws")
47
  >>> classifier("帝堯曰放勳")
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  ```
 
36
  AutoModel,
37
  )
38
 
39
+ tokenizer = AutoTokenizer.from_pretrained("ckiplab/han-bert-base-chinese-ws")
40
+ model = AutoModel.from_pretrained("ckiplab/han-bert-base-chinese-ws")
41
  ```
42
 
43
  * Using our model for inference
44
  ```python
45
  >>> from transformers import pipeline
46
+ >>> classifier = pipeline("token-classification", model="ckiplab/han-bert-base-chinese-ws")
47
  >>> classifier("帝堯曰放勳")
48
 
49
+ # output
50
+ [{'entity': 'B',
51
+ 'score': 0.9999793,
52
+ 'index': 1,
53
+ 'word': '帝',
54
+ 'start': 0,
55
+ 'end': 1},
56
+ {'entity': 'I',
57
+ 'score': 0.9915047,
58
+ 'index': 2,
59
+ 'word': '堯',
60
+ 'start': 1,
61
+ 'end': 2},
62
+ {'entity': 'B',
63
+ 'score': 0.99992275,
64
+ 'index': 3,
65
+ 'word': '曰',
66
+ 'start': 2,
67
+ 'end': 3},
68
+ {'entity': 'B',
69
+ 'score': 0.99905187,
70
+ 'index': 4,
71
+ 'word': '放',
72
+ 'start': 3,
73
+ 'end': 4},
74
+ {'entity': 'I',
75
+ 'score': 0.96299917,
76
+ 'index': 5,
77
+ 'word': '勳',
78
+ 'start': 4,
79
+ 'end': 5}]
80
  ```