sinatools.wsd.disambiguator

sinatools.wsd.disambiguator.disambiguate(sentence)

This method disambiguate words within a sentence. You can try the demo online.

Parameters
  • sentence (str) – The Arabic text to be disambiguated, it should be limited to less than 500 characters.

Returns

The JSON output includes a list of words, with each word having a concept id if it exists or a lemma if no gloss is found.

Return type

list

Example:

from sinatools.wsd.disambiguator import disambiguate
disambiguate('تمشيت بين الجداول والأنهار')
[{
    'concept_id': '303051631',
    'word': 'تمشيت',
    'undiac_lemma': 'تمشى',
    'diac_lemma': 'تَمَشَّى'
},{
    'word': 'بين',
    'undiac_lemma': 'بين',
    'diac_lemma': 'بَيْنَ'
},{
    'concept_id': '303007335',
    'word': 'الجداول',
    'undiac_lemma': 'جدول',
    'diac_lemma': 'جَدْوَلٌ'
},{
    'concept_id': '303056588',
    'word': 'والأنهار',
    'undiac_lemma': 'نهر',
    'diac_lemma': 'نَهْرٌ'
}]