Downloads · 30 days
8
17% of all-time downloads
davmel/ka_homonym_disambiguation_FM
ka_homonym_disambiguation_FM is a fill-mask model from davmel. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as mit.
<iframe src="https://davmel-georgian-homonym-disambiguation.hf.space" frameborder="0" width="850" height="450" </iframe
Downloads · 30 days
8
17% of all-time downloads
All-time downloads
48
Public
Parameters
67M
804 MB on disk
Likes
0
Public
Click a slice to open those files.
.pt536 MB · 67%
From the Hugging Face model README
This model is capable of determining the definition of the homonym "ბარი" located at the position marked by the [MASK] token.
It is a simple Transformer model fine-tuned on a dataset comprising 4800 hand-classified sentences.
It shows 95% accuracy on a test set comprising 1200 hand-classified sentences.
The original 6000 sentences were split into 80% training data and 20% testing data. <a href="https://huggingface.co/datasets/davmel/ka_homonym_disambiguation">link to dataset</a>
<h1>Methodology:</h1> I've masked the homonyms from the sentences and replaced them with their synonyms according to the definitions used. For example, I replaced ”ბარი” with ”დაბლობი” (lowland) where the homonym referred to the field.The model predicts "თო" when it interprets the homonym as "Shovel," "დაბ" when it interprets it as "lowland," and "კაფე" when it interprets it as "Cafe."
My fine-tuned transformer model is based on a pre-trained transformer model which was downloaded from: https://huggingface.co/Davit6174/georgian-distilbert-mlm
<h1>Usage example</h1>from transformers import pipeline, AutoModelForMaskedLM, AutoTokenizer
model = AutoModelForMaskedLM.from_pretrained('davmel/ka_homonym_disambiguation_FM')
tokenizer = AutoTokenizer.from_pretrained('davmel/ka_homonym_disambiguation_FM')
pipe = pipeline('fill-mask', model=model, tokenizer=tokenizer)
answer = {'თო': "თოხი", 'დაბ': 'დაბლობი', 'კაფე': "კაფე"}
answer_to_english = {"თო": "Shovel", "დაბ": "Lowland", "კაფე": "Cafe"}
#Make sure the sentence contains one [MASK] token (otherwise pipeline returns arrays of dictionaries).
sentence = 'აიღეთ ხელში [MASK], იმუშავეთ მიწაზე'
result = pipe(sentence)
print("The homonym is used as: ", answer_to_english[result[0]['token_str']])
print("ომონიმი \"ბარი\" გამოყენებულია როგორც ", answer[result[0]['token_str']])