readme: 
  ---
  language: et
  license: cc-by-4.0
  
  widget:
  - text: "Eesti President on Alar Karis."
  
  ---
  
  
  # Estonian NER model based on EstBERT
  
  This model is a fine-tuned version of [tartuNLP/EstBERT](https://huggingface.co/tartuNLP/EstBERT) on the Estonian NER dataset. The model was trained by tartuNLP, the NLP research group at the institute of Computer Science at the University of Tartu.
  
  It achieves the following results on the test set:
  
  - Loss: 0.3565  
  - Precision: 0.7612  
  - Recall: 0.7744  
  - F1: 0.7678  
  - Accuracy: 0.9672  
  
  The entity-level results are as follows:
  
  
  |         | Precision | Recall  | F1      | Number  |
  |---------| --------- | ------- | ------- | ------- |
  | DATE    | 0.7278    | 0.7258  | 0.7268  | 372     |
  | EVENT   | 0.3721    | 0.5714  | 0.4507  | 28      |
  | GPE     | 0.8679    | 0.8369  | 0.8521  | 840     |
  | LOC     | 0.6545    | 0.4832  | 0.5560  | 149     |
  | MONEY   | 0.6625    | 0.6023  | 0.6310  | 88      |
  | ORG     | 0.6761    | 0.7267  | 0.7005  | 589     |
  | PER     | 0.8255    | 0.9068  | 0.8642  | 751     |
  | PERCENT | 1.0       | 0.9589  | 0.9790  | 73      |
  | PROD    | 0.6030    | 0.5430  | 0.5714  | 221     |
  | TIME    | 0.5682    | 0.5556  | 0.5618  | 45      |
  | TITLE   | 0.7       | 0.8063  | 0.7494  | 191     |
  
  ## How to use 
  
  You can use this model with Transformers pipeline for NER. Post-processing of results may be necessary as the model occasionally tags subword tokens as entities. 
  
  ```
  from transformers import BertTokenizer, BertForTokenClassification
  from transformers import pipeline
  
  tokenizer = BertTokenizer.from_pretrained('tartuNLP/EstBERT_NER')
  bertner = BertForTokenClassification.from_pretrained('tartuNLP/EstBERT_NER')
  
  nlp = pipeline("ner", model=bertner, tokenizer=tokenizer)
  
  text = "Kaia Kanepi (WTA 57.) langes USA-s Charlestonis toimuval WTA 500 kategooria tenniseturniiril konkurentsist kaheksandikfinaalis, kaotades poolatarile Magda Linette'ile (WTA 64.) 3 : 6, 6 : 4, 2 : 6."
  
  ner_results = nlp(text)
  
  tokens=tokenizer(text)
  tokens=tokenizer.convert_ids_to_tokens(tokens['input_ids'])
  
  
  print(f'tokens: {tokens}')
  print(f'NER model:{ner_results}')
  
  ```
  ```
  tokens: ['[CLS]', 'kai', '##a', 'kanepi', '(', 'w', '##ta', '57', '.', ')', 'langes', 'usa', '-', 's', 'cha', '##rl', '##est', '##onis', 'toimuval', 'w', '##ta', '500', 'kategooria', 'tennise', '##turniiril', 'konkurentsist', 'kaheksandik', '##finaalis', ',', 'kaotades', 'poola', '##tari', '##le', 'ma', '##gda', 'line', '##tte', "'", 'ile', '(', 'w', '##ta', '64', '.', ')', '3', ':', '6', ',', '6', ':', '4', ',', '2', ':', '6', '.', '[SEP]']
  
  ```
  ```
  NER model: [{'entity': 'B-PER', 'score': 0.99999887, 'index': 1, 'word': 'kai', 'start': None, 'end': None}, {'entity': 'B-PER', 'score': 0.97371966, 'index': 2, 'word': '##a', 'start': None, 'end': None}, {'entity': 'I-PER', 'score': 0.99999815, 'index': 3, 'word': 'kanepi', 'start': None, 'end': None}, {'entity': 'B-ORG', 'score': 0.63085276, 'index': 5, 'word': 'w', 'start': None, 'end': None}, {'entity': 'B-GPE', 'score': 0.99999934, 'index': 11, 'word': 'usa', 'start': None, 'end': None}, {'entity': 'B-GPE', 'score': 0.9999685, 'index': 14, 'word': 'cha', 'start': None, 'end': None}, {'entity': 'I-GPE', 'score': 0.8875574, 'index': 15, 'word': '##rl', 'start': None, 'end': None}, {'entity': 'I-GPE', 'score': 0.9996168, 'index': 16, 'word': '##est', 'start': None, 'end': None}, {'entity': 'I-GPE', 'score': 0.9992657, 'index': 17, 'word': '##onis', 'start': None, 'end': None}, {'entity': 'B-EVENT', 'score': 0.99999064, 'index': 19, 'word': 'w', 'start': None, 'end': None}, {'entity': 'I-EVENT', 'score': 0.9772493, 'index': 20, 'word': '##ta', 'start': None, 'end': None}, {'entity': 'I-EVENT', 'score': 0.99999076, 'index': 21, 'word': '500', 'start': None, 'end': None}, {'entity': 'I-EVENT', 'score': 0.99955636, 'index': 22, 'word': 'kategooria', 'start': None, 'end': None}, {'entity': 'B-TITLE', 'score': 0.8771319, 'index': 30, 'word': 'poola', 'start': None, 'end': None}, {'entity': 'B-PER', 'score': 0.99999785, 'index': 33, 'word': 'ma', 'start': None, 'end': None}, {'entity': 'B-PER', 'score': 0.9998398, 'index': 34, 'word': '##gda', 'start': None, 'end': None}, {'entity': 'I-PER', 'score': 0.9999987, 'index': 35, 'word': 'line', 'start': None, 'end': None}, {'entity': 'I-PER', 'score': 0.9999976, 'index': 36, 'word': '##tte', 'start': None, 'end': None}, {'entity': 'I-PER', 'score': 0.99999285, 'index': 37, 'word': "'", 'start': None, 'end': None}, {'entity': 'I-PER', 'score': 0.9999794, 'index': 38, 'word': 'ile', 'start': None, 'end': None}, {'entity': 'B-ORG', 'score': 0.7664479, 'index': 40, 'word': 'w', 'start': None, 'end': None}]
  ```
  
  ## Intended uses & limitations
  
  This model can be used to find named entities from Estonian texts. The model is free to use for anyone. TartuNLP does not guarantee that the model is useful for anyone or anything. TartuNLP is not responsible for any results it generates.
  
  ## Training and evaluation data
  
  T