dreamerdeo commited on
Commit
eb0e28b
·
1 Parent(s): 52ac233

download from github

Browse files
Files changed (5) hide show
  1. README.md +1 -1
  2. dev.json +0 -3
  3. finqa.py +17 -9
  4. test.json +0 -3
  5. train.json +0 -3
README.md CHANGED
@@ -24,6 +24,6 @@ dataset_info:
24
  - name: test
25
  num_bytes: 4838430
26
  num_examples: 1147
27
- download_size: 0
28
  dataset_size: 35579663
29
  ---
 
24
  - name: test
25
  num_bytes: 4838430
26
  num_examples: 1147
27
+ download_size: 21240722
28
  dataset_size: 35579663
29
  ---
dev.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:fb1c0e213c04f12e464be3e5f2a681fb7790a434bdefa5947f71b928642529b8
3
- size 6911084
 
 
 
 
finqa.py CHANGED
@@ -19,6 +19,11 @@ import datasets
19
 
20
  import json
21
 
 
 
 
 
 
22
 
23
  class FinQA(datasets.GeneratorBasedBuilder):
24
 
@@ -41,9 +46,11 @@ class FinQA(datasets.GeneratorBasedBuilder):
41
  )
42
 
43
  def _split_generators(self, dl_manager):
44
- train_file = "train.json"
45
- dev_file = "dev.json"
46
- test_file = "test.json"
 
 
47
 
48
  return [
49
  datasets.SplitGenerator(
@@ -69,9 +76,10 @@ class FinQA(datasets.GeneratorBasedBuilder):
69
  lines = json.load(f)
70
  for idx, example in enumerate(lines):
71
  yield idx, {
72
- "id": example['id'], \
73
- "post_text": example['post_text'], \
74
- "pre_text": example['pre_text'], \
75
- "question": example['qa']['question'], \
76
- "answers": example['qa']['answer'], \
77
- "table": example['table'] }
 
 
19
 
20
  import json
21
 
22
+ _HOMEPAGE = "https://finqasite.github.io/index.html"
23
+
24
+ _GIT_ARCHIVE_URL = (
25
+ "https://github.com/czyssrs/FinQA/archive/refs/heads/main.zip"
26
+ )
27
 
28
  class FinQA(datasets.GeneratorBasedBuilder):
29
 
 
46
  )
47
 
48
  def _split_generators(self, dl_manager):
49
+ extracted_path = dl_manager.download_and_extract(_GIT_ARCHIVE_URL)
50
+ print(extracted_path)
51
+ train_file = os.path.join(extracted_path, "FinQA-main", "dataset", "train.json")
52
+ dev_file = os.path.join(extracted_path, "FinQA-main", "dataset", "dev.json")
53
+ test_file = os.path.join(extracted_path, "FinQA-main", "dataset", "test.json")
54
 
55
  return [
56
  datasets.SplitGenerator(
 
76
  lines = json.load(f)
77
  for idx, example in enumerate(lines):
78
  yield idx, {
79
+ "id": example['id'],
80
+ "post_text": example['post_text'],
81
+ "pre_text": example['pre_text'],
82
+ "question": example['qa']['question'],
83
+ "answers": example['qa']['answer'],
84
+ "table": example['table'],
85
+ }
test.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:dda0fbcf793a1b8252c0be74022aef2013acf73a8f018ed0385ea5025a9f732b
3
- size 9024474
 
 
 
 
train.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:69ba764bad30fcc60e1f0565630b33ca36205140e957996635bad9db59f42978
3
- size 49488703