Skip to main content
  • Python
  • Javascript
  • cURL
Python example:
from gradio_client import Client

client = Client("Remeinium/Embedding_Siyabasa")
result = client.predict(
    word="පෞරාණික",
    top_k=5,
    api_name="/nearest_neighbors"
)
print(json.dumps(result, indent=4))
Response format:
{
    "query": "පෞරාණික",
    "neighbors": [
        {"word": "ඉපැරණි", "similarity": 0.755...},
        {"word": "පුරාවිද්යාත්මක", "similarity": 0.749...},
        ...
    ],
    "model": "UgannA_SiyabasaV2"
}

Accepts 2 parameters:

  1. word : str *Required
    The input value that is provided in the “Query Word” Textbox component.
  2. top_k : float Default: 10
    The input value that is provided in the “Number of Results” Slider component.

Returns 1 element

str | float | bool | list | dict
The output value that appears in the “Similar Words” Json component.