
# Persian Reverse Dictionary

![Picture](pic1.png)

This project aims to create a Persian reverse dictionary model that suggests a word based on our input explanations. This model is based on Transformer encoders and uses fast text embedding.

## Dataset

The dataset used in this work is from [this link](https://www.kaggle.com/malekzadeharman/persian-reverse-dictionary-dataset). This dataset contains 855,217 data from Amid, Moein, and Dehkhoda dictionaries plus Farsnet and Persian Wikipedia.

## Overall

| Metric | Value |
|--------|-------|
| Top-10 accuracy | 16.72% |
| Top-100 accuracy | 33.89% |
| Top-10 Synonyms accuracy | 42.19% |
| Top-100 Synonyms accuracy | 62.72% |

## How to use

1. Clone the repository.
2. Install the required libraries.
3. Import the `PreTrainedPipeline` class from the script.
4. Instantiate the pipeline object with the path to the directory where the saved model and other required files are located.
5. Call the pipeline object on an input sentence.

Here's an example usage:

```python
from pipeline import PreTrainedPipeline

pipeline = PreTrainedPipeline("path/to/directory")

result = pipeline("وسیله حمل و نقل پرنده.")

print(result)
```

{"library_name": "generic", "tags": ["reverse-dictionary"], "metrics": ["accuracy"], "pipeline_tag": "text-classification", "widget": [{"text": "\u062c\u0627\u06cc\u06cc \u062f\u0627\u0631\u0627\u06cc \u06a9\u0644\u0627\u0633\u200c\u0647\u0627\u06cc \u0645\u062a\u0639\u062f\u062f \u0628\u0627 \u0627\u0645\u06a9\u0627\u0646\u0627\u062a \u0622\u0645\u0648\u0632\u0634\u06cc \u06a9\u0647 \u062f\u0631 \u0622\u0646 \u06a9\u0648\u062f\u06a9\u0627\u0646\u060c \u0646\u0648\u062c\u0648\u0627\u0646\u0627\u0646\u060c \u0648 \u062c\u0648\u0627\u0646\u0627\u0646 \u0632\u06cc\u0631 \u0646\u0638\u0631 \u0645\u0639\u0644\u0645\u0627\u0646 \u0622\u0645\u0648\u0632\u0634\u200c\u0647\u0627\u06cc \u0644\u0627\u0632\u0645 \u0631\u0627 \u0628\u0631 \u0627\u0633\u0627\u0633 \u0628\u0631\u0646\u0627\u0645\u0647 \u062f\u0631\u0633\u06cc \u0641\u0631\u0627 \u0645\u06cc\u200c\u06af\u06cc\u0631\u0646\u062f. \u0645\u062d\u0644 \u062f\u0631\u0633 \u062f\u0627\u062f\u0646 \u0648 \u0639\u0644\u0645 \u0622\u0645\u0648\u062e\u062a\u0646.", "example_title": "\u0645\u062f\u0631\u0633\u0647"}, {"text": "\u0628\u062e\u0634 \u0633\u062e\u062a \u0648 \u0645\u062d\u06a9\u0645 \u062f\u0631 \u062f\u0647\u0627\u0646 \u062c\u0627\u0646\u0648\u0631\u0627\u0646 \u06a9\u0647 \u0639\u0645\u0644 \u062c\u0648\u06cc\u062f\u0646 \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u200c\u062f\u0647\u062f", "example_title": "\u062f\u0646\u062f\u0627\u0646"}, {"text": "\u0632\u0628\u0627\u0646\u06cc \u0627\u0632 \u0634\u0627\u062e\u06c0 \u0632\u0628\u0627\u0646\u200c\u0647\u0627\u06cc \u0647\u0646\u062f\u0648\u0627\u06cc\u0631\u0627\u0646\u06cc \u06a9\u0647 \u062f\u0631 \u0627\u06cc\u0631\u0627\u0646 \u060c \u0627\u0641\u063a\u0627\u0646\u0633\u062a\u0627\u0646 \u0648 \u062a\u0627\u062c\u06cc\u06a9\u0633\u062a\u0627\u0646 \u0631\u0627\u06cc\u062c \u0627\u0633\u062a.", "example_title": "\u0641\u0627\u0631\u0633\u06cc"}, {"text": "\u062d\u0627\u0644\u062a\u06cc \u062a\u0648\u0623\u0645 \u0628\u0627 \u0622\u0633\u0627\u06cc\u0634 \u0648 \u0622\u0631\u0627\u0645\u0634 \u06a9\u0647 \u0628\u0631 \u0627\u062b\u0631 \u0627\u0632 \u06a9\u0627\u0631 \u0628\u0627\u0632\u0645\u0627\u0646\u062f\u0646 \u062d\u0648\u0627\u0633 \u0638\u0627\u0647\u0631 \u062f\u0631 \u0627\u0646\u0633\u0627\u0646 \u0648 \u062d\u06cc\u0648\u0627\u0646 \u067e\u062f\u06cc\u062f \u0622\u06cc\u062f", "example_title": "\u062e\u0648\u0627\u0628"}, {"text": "\u0645\u062c\u0645\u0648\u0639\u0647\u200c\u0627\u06cc \u0627\u0632 \u0646\u0648\u0634\u062a\u0647\u200c\u0647\u0627 \u06cc\u0627 \u062a\u0635\u0627\u0648\u06cc\u0631 \u0628\u0631 \u0631\u0648\u06cc \u0648\u0631\u0642\u200c\u0647\u0627\u06cc \u0646\u0627\u0632\u06a9\u060c \u0628\u0647 \u0635\u0648\u0631\u062a \u062e\u0637\u06cc \u06cc\u0627 \u0686\u0627\u067e\u06cc\u060c \u0635\u062d\u0627\u0641\u06cc \u0634\u062f\u0647\u060c \u0648 \u062f\u0627\u0631\u0627\u06cc \u062c\u0644\u062f", "example_title": "\u06a9\u062a\u0627\u0628"}]}
generic keras reverse-dictionary text-classification has_space region:us
TAGS
#generic #keras #reverse-dictionary #text-classification #has_space #region-us 

Persian Reverse Dictionary
==========================


!Picture


This project aims to create a Persian reverse dictionary model that suggests a word based on our input explanations. This model is based on Transformer encoders and uses fast text embedding.


Dataset
-------


The dataset used in this work is from this link. This dataset contains 855,217 data from Amid, Moein, and Dehkhoda dictionaries plus Farsnet and Persian Wikipedia.


Overall
-------



How to use
----------


1. Clone the repository.
2. Install the required libraries.
3. Import the 'PreTrainedPipeline' class from the script.
4. Instantiate the pipeline object with the path to the directory where the saved model and other required files are located.
5. Call the pipeline object on an input sentence.


Here's an example usage:



TAGS
#generic #keras #reverse-dictionary #text-classification #has_space #region-us 

TAGS
#generic #keras #reverse-dictionary #text-classification #has_space #region-us 
