Synonyms Generator

A dataset and source code for Synonyms Generator

Version: 1.0 (updated on 15/12/2022)

An algorithm to extend a set of synonyms with more synonyms. Given a set of synonyms, the algorithm builds a graph (using many dictionaries) and returns a set of candidate synonyms, each with a fuzzy value to indicate how much it is likely to be a synonym. The more synonyms in the input, the more accurate the candidate synonyms. We trained the fuzzy model using a dataset we built manually (500 synsets, with 3K candidate synonyms by four linguists). Please read this article for the details. Try the service (type synonym seperated by | or , or ،):

Accurecy:


Task:

Filters:





Level:




Lexicons:

POS:

The dataset is a set of 500 synsets (extracted from the Arabic Wordnet). Each synset is enriched with a list of candidate synonyms. The total number is 3K candidates. Each candidate synonym is then annotated with a fuzzy value by four linguists (in parallel). The dataset is important for understanding how much linguists (dis/)agree on synonymy (which we found RMSE: 32% and MAE: 27%). In addition, we used the dataset as a baseline to evaluate our algorithm. See the scoring guidelines, figures, and details in section 3.
License: MIT

Download: Github.Synonyms

Please email Prof. Mustafa Jarrar (mjarrar AT birzeit.edu) if you have any question.

Actors Authenticated user.
URL schema To extend synonyms: https://{domain}/sina/v2/api/SynonymGenerator/?apikey={key}
To evaluate synonyms: https://{domain}/sina/v2/api/EvaluateSynset/?apikey={key}
Pre-conditions The user has registered and provided their API Key.
API Parameters

    Each web service receives Synset, lexicons, POS, and level through the body. The boxes below demonstrate how to utilize these services by code using JavaScript and Python.

  1. Synset: mono/multilingual synset
  2. Lexicons: Select one or more of these lexicons (AWN, مكنز بيرزيت, Princeton WordNet, ALECSO, Cairo Academy)
  3. POS: part of speach (noun, verb, Functional word)
  4. Level: Level3 And Level4
  5. apikey: A key to access the API.
Flow of events
  1. The system checks if the API Key is authenticated or not.
  2. If not authenticated, the system returns (-3) error code in JSON format.
  3. If authenticated, and the access limit is not exceeded (if exceeded returns -1 in JSON format), then the system logs the request.
  4. If so the system extracts the entities from text.
  5. Otherwise, the system returns (-4) error code.
  6. The system returns the results in the specified format.
Retrieved Data For Extend: Return the candidate synonyms with their fuzzy values.
For Evaluate: Demonstrate the level of relatedness between the words within the entered synset.
Python code
	
											 from urllib.request import Request, urlopen
import json

data = {"synset" :["street","road"], "level" :"2", "task":"DB"}
data = json.dumps(data).encode('utf8')

req = Request(
    url="https://ontology.birzeit.edu/sina/v2/api/SynonymGenerator/?apikey=samplekey",
    data=data,
    headers={'User-Agent': 'Mozilla/5.0', 'Content-Type': 'application/json'},
    method='POST'
)
webpage = urlopen(req).read()
print(webpage.decode())
										
											 
											
from urllib.request import Request, urlopen
import json

data = {"synset" :["street","road"], "level" :"2", "task":"DB"}
data = json.dumps(data).encode('utf8')

req = Request(
    url="https://ontology.birzeit.edu/sina/v2/api/EvaluateSynset/?apikey=samplekey",
    data=data,
    headers={'User-Agent': 'Mozilla/5.0', 'Content-Type': 'application/json'},
    method='POST'
)
webpage = urlopen(req).read()
print(webpage.decode())
										
Javascript code
							 
$.ajax({
	url: "https://ontology.birzeit.edu/sina/v2/api/SynonymGenerator/?apikey=sampleKey",
	data: JSON.stringify({"synset" :["street","road"], "level" :"2", "task":"DB"}),
	type: "POST",
	success: function (data) {
        console.log(data["resp"]);
	}
});		
							
							
							 
$.ajax({
	url: "https://ontology.birzeit.edu/sina/v2/api/EvaluateSynset/?apikey=sampleKey",
	data: JSON.stringify({"synset" :["street","road"], "level" :"2", "task":"DB"}),
	type: "POST",
	success: function (data) {
        console.log(data["resp"]);
	}
});
							
							

Sana Ghanem, Mustafa Jarrar, Radi Jarrar, Ibrahim Bounhas: A Benchmark and Scoring Algorithm for Enriching Arabic Synonyms. In Proceedings of the Global WordNet Conference (gwc2023), Donostia, January. 2023

PDF - Slides