vitus9988 commited on
Commit
3bb7936
1 Parent(s): 9bd4e53

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -0
README.md CHANGED
@@ -73,3 +73,30 @@ The following hyperparameters were used during training:
73
  - Pytorch 2.3.0+cu118
74
  - Datasets 2.19.1
75
  - Tokenizers 0.19.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  - Pytorch 2.3.0+cu118
74
  - Datasets 2.19.1
75
  - Tokenizers 0.19.1
76
+
77
+ ### Use
78
+
79
+ ```python
80
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
81
+ from transformers import pipeline
82
+
83
+ tokenizer = AutoTokenizer.from_pretrained("vitus9988/klue-roberta-small-ner-identified")
84
+ model = AutoModelForTokenClassification.from_pretrained("vitus9988/klue-roberta-small-ner-identified")
85
+
86
+ nlp = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
87
+ example = """
88
+ 저는 김철수입니다. 집은 서울특별시 강남대로이고 전화번호는 010-1234-5678, 주민등록번호는 123456-1234567입니다. 메일주소는 [email protected]입니다. 저는 10월 25일에 출국할 예정입니다.
89
+ """
90
+
91
+ ner_results = nlp(example)
92
+ for i in ner_results:
93
+ print(i)
94
+
95
+ #{'entity_group': 'PS', 'score': 0.9617835, 'word': '김철수', 'start': 3, 'end': 6}
96
+ #{'entity_group': 'AD', 'score': 0.9839702, 'word': '서울특별시 강남대로', 'start': 14, 'end': 24}
97
+ #{'entity_group': 'PH', 'score': 0.9906756, 'word': '010 - 1234 - 5678', 'start': 33, 'end': 46}
98
+ #{'entity_group': 'RN', 'score': 0.9904553, 'word': '123456 - 1234567', 'start': 56, 'end': 70}
99
+ #{'entity_group': 'EM', 'score': 0.99022245, 'word': 'hugging @ face. com', 'start': 81, 'end': 97}
100
+ #{'entity_group': 'DT', 'score': 0.985629, 'word': '10월 25일', 'start': 105, 'end': 112}
101
+
102
+ ```