Datasets:

Languages:
English
ArXiv:
License:
dfki-nlp commited on
Commit
3783c46
1 Parent(s): 4910145

Update tacred.py

Browse files
Files changed (1) hide show
  1. tacred.py +8 -11
tacred.py CHANGED
@@ -1,6 +1,3 @@
1
- """TODO: Add a description here."""
2
-
3
-
4
  import json
5
  import os
6
 
@@ -44,15 +41,15 @@ _CITATION = """\
44
  # You can copy an official description
45
  _DESCRIPTION = """\
46
  TACRED is a large-scale relation extraction dataset with 106,264 examples built over newswire
47
- and web text from the corpus used in the yearly TAC Knowledge Base Population (TAC KBP) challenges.
48
- Examples in TACRED cover 41 relation types as used in the TAC KBP challenges (e.g., per:schools_attended
49
- and org:members) or are labeled as no_relation if no defined relation is held. These examples are created
50
  by combining available human annotations from the TAC KBP challenges and crowdsourcing.
51
-
52
  Please see our EMNLP paper, or our EMNLP slides for full details.
53
 
54
- Note: There is currently a label-corrected version of the TACRED dataset, which you should consider using instead of
55
- the original version released in 2017. For more details on this new version, see the TACRED Revisited paper
56
  published at ACL 2020.
57
  """
58
 
@@ -131,7 +128,7 @@ def convert_ptb_token(token: str) -> str:
131
 
132
  class Tacred(datasets.GeneratorBasedBuilder):
133
  """TACRED is a large-scale relation extraction dataset with 106,264 examples built over newswire
134
- and web text from the corpus used in the yearly TAC Knowledge Base Population (TAC KBP) challenges."""
135
 
136
  BUILDER_CONFIGS = [
137
  datasets.BuilderConfig(
@@ -268,5 +265,5 @@ class Tacred(datasets.GeneratorBasedBuilder):
268
  "pos_tags": example["stanford_pos"],
269
  "ner_tags": example["stanford_ner"],
270
  "stanford_deprel": example["stanford_deprel"],
271
- "stanford_head": example["stanford_head"]
272
  }
 
 
 
 
1
  import json
2
  import os
3
 
 
41
  # You can copy an official description
42
  _DESCRIPTION = """\
43
  TACRED is a large-scale relation extraction dataset with 106,264 examples built over newswire
44
+ and web text from the corpus used in the yearly TAC Knowledge Base Population (TAC KBP) challenges.
45
+ Examples in TACRED cover 41 relation types as used in the TAC KBP challenges (e.g., per:schools_attended
46
+ and org:members) or are labeled as no_relation if no defined relation is held. These examples are created
47
  by combining available human annotations from the TAC KBP challenges and crowdsourcing.
48
+
49
  Please see our EMNLP paper, or our EMNLP slides for full details.
50
 
51
+ Note: There is currently a label-corrected version of the TACRED dataset, which you should consider using instead of
52
+ the original version released in 2017. For more details on this new version, see the TACRED Revisited paper
53
  published at ACL 2020.
54
  """
55
 
 
128
 
129
  class Tacred(datasets.GeneratorBasedBuilder):
130
  """TACRED is a large-scale relation extraction dataset with 106,264 examples built over newswire
131
+ and web text from the corpus used in the yearly TAC Knowledge Base Population (TAC KBP) challenges."""
132
 
133
  BUILDER_CONFIGS = [
134
  datasets.BuilderConfig(
 
265
  "pos_tags": example["stanford_pos"],
266
  "ner_tags": example["stanford_ner"],
267
  "stanford_deprel": example["stanford_deprel"],
268
+ "stanford_head": example["stanford_head"] - 1, # make offsets 0-based
269
  }