abhilash1910
commited on
Commit
·
0ec3178
1
Parent(s):
b59f050
Readme
Browse files
Readme.md
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## German NER Albert Model
|
2 |
+
|
3 |
+
This is a trained Albert model for Token Classification in German ,[Germeval](https://sites.google.com/site/germeval2014ner/) and can be used for Inference.
|
4 |
+
|
5 |
+
|
6 |
+
## Model Specifications
|
7 |
+
|
8 |
+
- MAX_LENGTH=128
|
9 |
+
- MODEL='albert-base-v1'
|
10 |
+
- BATCH_SIZE=32
|
11 |
+
- NUM_EPOCHS=3
|
12 |
+
- SAVE_STEPS=750
|
13 |
+
- SEED=1
|
14 |
+
- SAVE_STEPS = 100
|
15 |
+
- LOGGING_STEPS = 100
|
16 |
+
- SEED = 42
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
### Usage Specifications
|
21 |
+
|
22 |
+
This model is trained on Tensorflow version and is compatible with the 'ner' pipeline of huggingface.
|
23 |
+
|
24 |
+
```python
|
25 |
+
from transformers import AutoTokenizer,TFAutoModelForTokenClassification
|
26 |
+
from transformers import pipeline
|
27 |
+
|
28 |
+
model=TFAutoModelForTokenClassification.from_pretrained('abhilash1910/albert-german-ner')
|
29 |
+
tokenizer=AutoTokenizer.from_pretrained('abhilash1910/albert-german-ner')
|
30 |
+
ner_model = pipeline('ner', model=model, tokenizer=tokenizer)
|
31 |
+
seq='Berlin ist die Hauptstadt von Deutschland'
|
32 |
+
ner_model(seq)
|
33 |
+
```
|
34 |
+
|
35 |
+
The Tensorflow version of Albert is used for training the model and the output for the above mentioned segment is as follows:
|
36 |
+
|
37 |
+
```
|
38 |
+
[{'entity': 'B-PERderiv',
|
39 |
+
'index': 1,
|
40 |
+
'score': 0.09580112248659134,
|
41 |
+
'word': '▁berlin'},
|
42 |
+
{'entity': 'B-ORGpart',
|
43 |
+
'index': 2,
|
44 |
+
'score': 0.08364498615264893,
|
45 |
+
'word': '▁is'},
|
46 |
+
{'entity': 'B-LOCderiv',
|
47 |
+
'index': 3,
|
48 |
+
'score': 0.07593920826911926,
|
49 |
+
'word': 't'},
|
50 |
+
{'entity': 'B-PERderiv',
|
51 |
+
'index': 4,
|
52 |
+
'score': 0.09574996680021286,
|
53 |
+
'word': '▁die'},
|
54 |
+
{'entity': 'B-LOCderiv',
|
55 |
+
'index': 5,
|
56 |
+
'score': 0.07097965478897095,
|
57 |
+
'word': '▁'},
|
58 |
+
{'entity': 'B-PERderiv',
|
59 |
+
'index': 6,
|
60 |
+
'score': 0.07122448086738586,
|
61 |
+
'word': 'haupt'},
|
62 |
+
{'entity': 'B-PERderiv',
|
63 |
+
'index': 7,
|
64 |
+
'score': 0.12397754937410355,
|
65 |
+
'word': 'stadt'},
|
66 |
+
{'entity': 'I-OTHderiv',
|
67 |
+
'index': 8,
|
68 |
+
'score': 0.0818650871515274,
|
69 |
+
'word': '▁von'},
|
70 |
+
{'entity': 'I-LOCderiv',
|
71 |
+
'index': 9,
|
72 |
+
'score': 0.08271490037441254,
|
73 |
+
'word': '▁'},
|
74 |
+
{'entity': 'B-LOCderiv',
|
75 |
+
'index': 10,
|
76 |
+
'score': 0.08616268634796143,
|
77 |
+
'word': 'deutschland'}]
|
78 |
+
```
|
79 |
+
|
80 |
+
## Resources
|
81 |
+
|
82 |
+
For all resources , please look into [huggingface](https://huggingface.com).
|