Commit
·
66e8ffc
1
Parent(s):
ea5e507
Update stan_small.py
Browse files- stan_small.py +2 -0
stan_small.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
import datasets
|
4 |
import pandas as pd
|
|
|
5 |
|
6 |
_CITATION = """
|
7 |
@misc{bansal2015deep,
|
@@ -78,6 +79,7 @@ class StanSmall(datasets.GeneratorBasedBuilder):
|
|
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)
|
|
|
2 |
|
3 |
import datasets
|
4 |
import pandas as pd
|
5 |
+
import ast
|
6 |
|
7 |
_CITATION = """
|
8 |
@misc{bansal2015deep,
|
|
|
79 |
return alts
|
80 |
|
81 |
records = pd.read_csv(filepath).to_dict("records")
|
82 |
+
records = [{"hashtags": row["hashtags"], "goldtruths": ast.literal_eval(row["goldtruths"])} for row in records]
|
83 |
for idx, row in enumerate(records):
|
84 |
segmentation = get_segmentation(row)
|
85 |
alternatives = get_alternatives(row, segmentation)
|