Commit
·
ea5e507
1
Parent(s):
df3effc
Update stan_small.py
Browse files- stan_small.py +2 -15
stan_small.py
CHANGED
@@ -18,7 +18,7 @@ _DESCRIPTION = """
|
|
18 |
Manually Annotated Stanford Sentiment Analysis Dataset by Bansal et al..
|
19 |
"""
|
20 |
_URLS = {
|
21 |
-
"test": "https://
|
22 |
}
|
23 |
|
24 |
class StanSmall(datasets.GeneratorBasedBuilder):
|
@@ -77,20 +77,7 @@ class StanSmall(datasets.GeneratorBasedBuilder):
|
|
77 |
alts = [{"segmentation": x} for x in alts]
|
78 |
return alts
|
79 |
|
80 |
-
|
81 |
-
try:
|
82 |
-
import pickle
|
83 |
-
records = pickle.load(f)
|
84 |
-
except ValueError:
|
85 |
-
try:
|
86 |
-
import pickle5 as pickle
|
87 |
-
records = pickle.load(f)
|
88 |
-
except ModuleNotFoundError:
|
89 |
-
raise ImportError(
|
90 |
-
"""To be able to use stan_small, you need to install the following dependencies['pickle5']
|
91 |
-
using 'pip install pickle5' for instance"""
|
92 |
-
)
|
93 |
-
records = records.to_dict("records")
|
94 |
for idx, row in enumerate(records):
|
95 |
segmentation = get_segmentation(row)
|
96 |
alternatives = get_alternatives(row, segmentation)
|
|
|
18 |
Manually Annotated Stanford Sentiment Analysis Dataset by Bansal et al..
|
19 |
"""
|
20 |
_URLS = {
|
21 |
+
"test": "https://raw.githubusercontent.com/ruanchaves/hashformers/master/datasets/stan_small.csv"
|
22 |
}
|
23 |
|
24 |
class StanSmall(datasets.GeneratorBasedBuilder):
|
|
|
77 |
alts = [{"segmentation": x} for x in alts]
|
78 |
return alts
|
79 |
|
80 |
+
records = pd.read_csv(filepath).to_dict("records")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
for idx, row in enumerate(records):
|
82 |
segmentation = get_segmentation(row)
|
83 |
alternatives = get_alternatives(row, segmentation)
|