azarijafari commited on
Commit
6279b65
1 Parent(s): f37ba36

Upload 6 files

Browse files
README.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## FarsTail: A Persian Natural Language Inference Dataset
2
+
3
+
4
+ ![alt-text](./farstail.png)
5
+
6
+ Natural Language Inference (NLI), also called [Textual Entailment](https://en.wikipedia.org/wiki/Textual_entailment), is an important task in NLP with the goal of determining the inference relationship between a premise `p` and a hypothesis `h`. It is a three-class problem where each pair `(p, h)` is assigned to one of these classes: "ENTAILMENT" if the hypothesis can be inferred from the premise, "CONTRADICTION" if the hypothesis contradicts the premise, and "NEUTRAL" if none of the above holds.
7
+ <br>There are large datasets such as [SNLI](https://www.aclweb.org/anthology/D15-1075/), [MNLI](https://www.aclweb.org/anthology/N18-1101/), and [SciTail](https://www.aaai.org/ocs/index.php/AAAI/AAAI18/paper/viewFile/17368/16067) for NLI in English, but there are few datasets for poor-data languages like [Persian](https://en.wikipedia.org/wiki/Persian_language).
8
+ <br>Persian (Farsi) language is a pluricentric language spoken by around 110 million people in countries like Iran, Afghanistan, and Tajikistan. Here, we present the first relatively large-scale Persian dataset for NLI task, called FarsTail. A total of 10,367 samples are generated from a collection of 3,539 multiple-choice questions. The train, validation, and test portions include 7,266, 1,537, and 1,564 instances, respectively. Please refer to [the manuscript](https://arxiv.org/abs/2009.08820) for more details.
9
+
10
+ ## Reading data
11
+ To read the raw data in Persian alphabet, use the following code:
12
+ ```python
13
+ train_data = pd.read_csv('data/Train-word.csv', sep='\t')
14
+ val_data = pd.read_csv('data/Val-word.csv', sep='\t')
15
+ test_data = pd.read_csv('data/Test-word.csv', sep='\t')
16
+ ```
17
+ The `train_data` and `val_data` have three columns, `premise`, `hypothesis`, and `label`. The `test_data` has two more columns denoted as *hard(hypothesis)* and *hard(overlap)* which indicate whether or not each sample belongs to the hard subset based on the *hypothesis-only* and *overlap-based* biased models, respectively.
18
+
19
+ Non-Persian researchers can use the following code to read the indexed data:
20
+ ```python
21
+ with np.load('data/Indexed-FarsTail.npz', allow_pickle=True) as f:
22
+ train_ind, val_ind, test_ind, dictionary = f['train_ind'], f['val_ind'], f['test_ind'], f['dictionary'].item()
23
+ ```
24
+ The `train_ind` and `val_ind` are numpy arrays with the shape of `(n, 3)` where `n` is the number of samples in each set. Each entry in these arrays includes the tokenized, indexed version of the premise and hypothesis along with the respective label for one instance. The entries of `test_ind` variable have two more elements corresponding to the *hard(hypothesis)* and *hard(overlap)* columns, respectively. The `dictionary` variable maps the indexes to tokens.
25
+
26
+
27
+ ## Results
28
+ Here is test accuracies obtained by training some models on FarsTail training set. Please refer to the manuscript for more results.
29
+
30
+ | Model | Test Accuracy | Hypothesis-only (Easy) | Hypothesis-only (Hard) | Overlap-based (Easy) | Overlap-based (Hard) |
31
+ | --- | --- | --- | --- | --- | --- |
32
+ |**DecompAtt (word2vec)** | **0.6662** | **0.7341** | **0.5823** | **0.7633** | **0.5404**|
33
+ |**HBMP (word2vec)** | **0.6604** | **0.7618** | **0.5350** | **0.7565** | **0.5360** |
34
+ |**ESIM (fastText)** | **0.7116** | **0.7931** | **0.6109** | **0.8120** | **0.5815** |
35
+ |**mBERT** | **0.8338** | **0.8763** | **0.7811** | **0.8981** | **0.7504** |
36
+
37
+
38
+ ## Reference
39
+
40
+ ```bibtex
41
+ @article{amirkhani2020farstail,
42
+ title={FarsTail: A Persian Natural Language Inference Dataset},
43
+ author={Hossein Amirkhani, Mohammad Azari Jafari, Azadeh Amirak, Zohreh Pourjafari, Soroush Faridan Jahromi, and Zeinab Kouhkan},
44
+ journal={arXiv preprint arXiv:2009.08820},
45
+ year={2020}
46
+ }
47
+ ```
data/Indexed-FarsTail.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c69d41ca97bb69dfdd17b72aab5dcc13526be0193d40e389619da32192349e71
3
+ size 2141558
data/Test-word.csv ADDED
The diff for this file is too large to render. See raw diff
 
data/Train-word.csv ADDED
The diff for this file is too large to render. See raw diff
 
data/Val-word.csv ADDED
The diff for this file is too large to render. See raw diff
 
farstail.png ADDED

Git LFS Details

  • SHA256: ec6bb7a1139771de11510bced6807d24cd129207a77e6d36c53899c088211b03
  • Pointer size: 131 Bytes
  • Size of remote file: 135 kB