wietsedv commited on
Commit
362c754
1 Parent(s): b91f57d

Update udpos28.py

Browse files
Files changed (1) hide show
  1. udpos28.py +7 -7
udpos28.py CHANGED
@@ -694,8 +694,8 @@ class Udpos28(datasets.GeneratorBasedBuilder):
694
  features=datasets.Features({
695
  "idx":
696
  datasets.Value("string"),
697
- # "text":
698
- # datasets.Value("string"),
699
  "tokens":
700
  datasets.Sequence(datasets.Value("string")),
701
  # "lemmas":
@@ -792,14 +792,14 @@ class Udpos28(datasets.GeneratorBasedBuilder):
792
  if "_" in tokens or "_" in upos:
793
  continue
794
 
795
- # if "text" in sent.metadata:
796
- # txt = sent.metadata["text"]
797
- # else:
798
- # txt = " ".join(tokens)
799
 
800
  yield id, {
801
  "idx": str(idx),
802
- # "text": txt,
803
  "tokens": tokens,
804
  # "lemmas": [token["lemma"] for token in sent],
805
  "labels": upos,
 
694
  features=datasets.Features({
695
  "idx":
696
  datasets.Value("string"),
697
+ "text":
698
+ datasets.Value("string"),
699
  "tokens":
700
  datasets.Sequence(datasets.Value("string")),
701
  # "lemmas":
 
792
  if "_" in tokens or "_" in upos:
793
  continue
794
 
795
+ if "text" in sent.metadata:
796
+ txt = sent.metadata["text"]
797
+ else:
798
+ txt = " ".join(tokens)
799
 
800
  yield id, {
801
  "idx": str(idx),
802
+ "text": txt,
803
  "tokens": tokens,
804
  # "lemmas": [token["lemma"] for token in sent],
805
  "labels": upos,