change full text feature config
Browse files- super_scirep_config.py +9 -9
super_scirep_config.py
CHANGED
@@ -33,7 +33,7 @@ class SuperSciRepConfig(datasets.BuilderConfig):
|
|
33 |
@classmethod
|
34 |
def get_features(self, feature_names: List[str], type_mapping: Dict[str, Any] = None) -> Dict[str, Any]:
|
35 |
|
36 |
-
full_text_mapping = {"full_text":
|
37 |
type_mapping = {**full_text_mapping, **type_mapping}
|
38 |
features = {name: type_mapping[name] if name in type_mapping else datasets.Value("string") for name in
|
39 |
feature_names}
|
@@ -71,14 +71,14 @@ SUPERSCIREPEVAL_CONFIGS = [
|
|
71 |
"title": datasets.Value("string"),
|
72 |
"abstract": datasets.Value(
|
73 |
"string"),
|
74 |
-
"full_text":
|
75 |
"corpus_id": datasets.Value("uint64")},
|
76 |
"candidates":
|
77 |
[{"doc_id": datasets.Value("string"),
|
78 |
"title": datasets.Value("string"),
|
79 |
"abstract": datasets.Value(
|
80 |
"string"),
|
81 |
-
"full_text":
|
82 |
"corpus_id": datasets.Value("uint64"),
|
83 |
"score": datasets.Value("uint32")}]}),
|
84 |
task_type="proximity", is_training=True, description=""),
|
@@ -92,7 +92,7 @@ SUPERSCIREPEVAL_CONFIGS = [
|
|
92 |
"title": datasets.Value("string"),
|
93 |
"abstract": datasets.Value(
|
94 |
"string"),
|
95 |
-
"full_text":
|
96 |
"corpus_id": datasets.Value("uint64"),
|
97 |
"venue": datasets.Value("string"),
|
98 |
"year": datasets.Value("float64"),
|
@@ -110,7 +110,7 @@ SUPERSCIREPEVAL_CONFIGS = [
|
|
110 |
"title": datasets.Value("string"),
|
111 |
"abstract": datasets.Value(
|
112 |
"string"),
|
113 |
-
"full_text":
|
114 |
"corpus_id": datasets.Value("uint64")},
|
115 |
"candidates":
|
116 |
[{
|
@@ -118,7 +118,7 @@ SUPERSCIREPEVAL_CONFIGS = [
|
|
118 |
"title": datasets.Value("string"),
|
119 |
"abstract": datasets.Value(
|
120 |
"string"),
|
121 |
-
"full_text":
|
122 |
"corpus_id": datasets.Value("uint64"),
|
123 |
"score": datasets.Value("uint32")}]}),
|
124 |
task_type="proximity", description="", url="feeds/feeds_1"),
|
@@ -130,7 +130,7 @@ SUPERSCIREPEVAL_CONFIGS = [
|
|
130 |
"title": datasets.Value("string"),
|
131 |
"abstract": datasets.Value(
|
132 |
"string"),
|
133 |
-
"full_text":
|
134 |
"corpus_id": datasets.Value("uint64")},
|
135 |
"candidates":
|
136 |
[{
|
@@ -138,7 +138,7 @@ SUPERSCIREPEVAL_CONFIGS = [
|
|
138 |
"title": datasets.Value("string"),
|
139 |
"abstract": datasets.Value(
|
140 |
"string"),
|
141 |
-
"full_text":
|
142 |
"corpus_id": datasets.Value("uint64"),
|
143 |
"score": datasets.Value("uint32")}]}),
|
144 |
task_type="proximity", description="", url="feeds/feeds_m"),
|
@@ -151,7 +151,7 @@ SUPERSCIREPEVAL_CONFIGS = [
|
|
151 |
"title": datasets.Value("string"),
|
152 |
"abstract": datasets.Value(
|
153 |
"string"),
|
154 |
-
"full_text":
|
155 |
"corpus_id": datasets.Value("uint64"),
|
156 |
"score": datasets.Value("uint32")}]}),
|
157 |
task_type="search", description="", url="feeds/feeds_title"),
|
|
|
33 |
@classmethod
|
34 |
def get_features(self, feature_names: List[str], type_mapping: Dict[str, Any] = None) -> Dict[str, Any]:
|
35 |
|
36 |
+
full_text_mapping = {"full_text": [{"title": datasets.Value("string"), "sentences": datasets.features.Sequence(datasets.Value("string"))}]}
|
37 |
type_mapping = {**full_text_mapping, **type_mapping}
|
38 |
features = {name: type_mapping[name] if name in type_mapping else datasets.Value("string") for name in
|
39 |
feature_names}
|
|
|
71 |
"title": datasets.Value("string"),
|
72 |
"abstract": datasets.Value(
|
73 |
"string"),
|
74 |
+
"full_text": [{"title": datasets.Value("string"), "sentences": datasets.features.Sequence(datasets.Value("string"))}],
|
75 |
"corpus_id": datasets.Value("uint64")},
|
76 |
"candidates":
|
77 |
[{"doc_id": datasets.Value("string"),
|
78 |
"title": datasets.Value("string"),
|
79 |
"abstract": datasets.Value(
|
80 |
"string"),
|
81 |
+
"full_text": [{"title": datasets.Value("string"), "sentences": datasets.features.Sequence(datasets.Value("string"))}],
|
82 |
"corpus_id": datasets.Value("uint64"),
|
83 |
"score": datasets.Value("uint32")}]}),
|
84 |
task_type="proximity", is_training=True, description=""),
|
|
|
92 |
"title": datasets.Value("string"),
|
93 |
"abstract": datasets.Value(
|
94 |
"string"),
|
95 |
+
"full_text": [{"title": datasets.Value("string"), "sentences": datasets.features.Sequence(datasets.Value("string"))}],
|
96 |
"corpus_id": datasets.Value("uint64"),
|
97 |
"venue": datasets.Value("string"),
|
98 |
"year": datasets.Value("float64"),
|
|
|
110 |
"title": datasets.Value("string"),
|
111 |
"abstract": datasets.Value(
|
112 |
"string"),
|
113 |
+
"full_text": [{"title": datasets.Value("string"), "sentences": datasets.features.Sequence(datasets.Value("string"))}],
|
114 |
"corpus_id": datasets.Value("uint64")},
|
115 |
"candidates":
|
116 |
[{
|
|
|
118 |
"title": datasets.Value("string"),
|
119 |
"abstract": datasets.Value(
|
120 |
"string"),
|
121 |
+
"full_text": [{"title": datasets.Value("string"), "sentences": datasets.features.Sequence(datasets.Value("string"))}],
|
122 |
"corpus_id": datasets.Value("uint64"),
|
123 |
"score": datasets.Value("uint32")}]}),
|
124 |
task_type="proximity", description="", url="feeds/feeds_1"),
|
|
|
130 |
"title": datasets.Value("string"),
|
131 |
"abstract": datasets.Value(
|
132 |
"string"),
|
133 |
+
"full_text": [{"title": datasets.Value("string"), "sentences": datasets.features.Sequence(datasets.Value("string"))}],
|
134 |
"corpus_id": datasets.Value("uint64")},
|
135 |
"candidates":
|
136 |
[{
|
|
|
138 |
"title": datasets.Value("string"),
|
139 |
"abstract": datasets.Value(
|
140 |
"string"),
|
141 |
+
"full_text": [{"title": datasets.Value("string"), "sentences": datasets.features.Sequence(datasets.Value("string"))}],
|
142 |
"corpus_id": datasets.Value("uint64"),
|
143 |
"score": datasets.Value("uint32")}]}),
|
144 |
task_type="proximity", description="", url="feeds/feeds_m"),
|
|
|
151 |
"title": datasets.Value("string"),
|
152 |
"abstract": datasets.Value(
|
153 |
"string"),
|
154 |
+
"full_text": [{"title": datasets.Value("string"), "sentences": datasets.features.Sequence(datasets.Value("string"))}],
|
155 |
"corpus_id": datasets.Value("uint64"),
|
156 |
"score": datasets.Value("uint32")}]}),
|
157 |
task_type="search", description="", url="feeds/feeds_title"),
|