File size: 2,406 Bytes
5ec2754
a6ab273
95b1847
 
 
 
e2fa873
6ebd1b8
 
 
 
 
 
 
 
 
 
 
7c45f95
0d4e2c5
c738df9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
library_name: generic
metrics:
- accuracy
tags:
- reverse-dictionary
pipeline_tag: text-classification
widget:
- text: "جایی دارای کلاس‌های متعدد با امکانات آموزشی که در آن کودکان، نوجوانان، و جوانان زیر نظر معلمان آموزش‌های لازم را بر اساس برنامه درسی فرا می‌گیرند. محل درس دادن و علم آموختن."
  example_title: "مدرسه"
- text: "بخش سخت و محکم در دهان جانوران که عمل جویدن را انجام می‌دهد"
  example_title: "دندان"
- text: "زبانی از شاخۀ زبان‌های هندوایرانی که در ایران ، افغانستان و تاجیکستان رایج است."
  example_title: "فارسی"
- text: "حالتی توأم با آسایش و آرامش که بر اثر از کار بازماندن حواس ظاهر در انسان و حیوان پدید آید"
  example_title: "خواب"
- text: "مجموعه‌ای از نوشته‌ها یا تصاویر بر روی ورق‌های نازک، به صورت خطی یا چاپی، صحافی شده، و دارای جلد"
  example_title: "کتاب"
---

# Persian Reverse Dictionary

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)
```