> ## Documentation Index
> Fetch the complete documentation index at: https://developers.remeinium.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# /word_similarity

> Compute the similarity between two Sinhala words.

<Tabs>
  <Tab title="Python">
    **Python example:**

    ```python theme={null}
    from gradio_client import Client

    client = Client("Remeinium/Embedding_Siyabasa")
    result = client.predict(
    	word1="අම්මා",
    	word2="තාත්තා",
    	api_name="/word_similarity"
    )
    print(json.dumps(result, indent=4))
    ```

    **Response format:**

    ```json theme={null}
    {
        "word1": "අම්මා",
        "word2": "තාත්තා",
        "similarity": 0.856234,
        "model": "UgannA_SiyabasaV2"
    }
    ```
  </Tab>

  <Tab title="Javascript">
    ```javascript theme={null}
    import { Client } from "@gradio/client";
    	
    	const client = await Client.connect("Remeinium/Embedding_Siyabasa");
    	const result = await client.predict("/word_similarity", { 		
    			word1: "අම්මා", 		
    			word2: "තාත්තා", 
    	});

    	console.log(result.data);
    ```

    **Response format:**

    ```json theme={null}
    {
        "word1": "අම්මා",
        "word2": "තාත්තා",
        "similarity": 0.856234,
        "model": "UgannA_SiyabasaV2"
    }
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST https://remeinium-embedding-siyabasa.hf.space/gradio_api/call/word_similarity -s -H "Content-Type: application/json" -d '{
    	"data": ["අම්මා",
    			"තාත්තා"
    			]}' \
    	| awk -F'"' '{ print $4}'  \
    	| read EVENT_ID; curl -N https://remeinium-embedding-siyabasa.hf.space/gradio_api/call/word_similarity/$EVENT_ID
    ```

    **Response format:**

    ```json theme={null}
    {
        "word1": "අම්මා",
        "word2": "තාත්තා",
        "similarity": 0.856234,
        "model": "UgannA_SiyabasaV2"
    }
    ```
  </Tab>
</Tabs>

#### **Accepts 2 parameters:**

1. `word1` :`string` \**<u>Required</u>*

   > The input value that is provided in the "Word 1" Textbox component.
2. `word2` : `string` \**<u>Required</u>*

   > The input value that is provided in the "Word 2: Textbox component.

#### **Returns 1 element**

`str | float | bool | list | dict`

> The output value that appears in the "Similarity Result" Json component.
