ljvmiranda921 commited on
Commit
969f2e4
1 Parent(s): 3281e02

Fix loading script

Browse files
Files changed (2) hide show
  1. .gitattributes +1 -0
  2. tlunified-ner.py +8 -7
.gitattributes CHANGED
@@ -56,3 +56,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
56
  corpus/iob/dev.iob filter=lfs diff=lfs merge=lfs -text
57
  corpus/iob/test.iob filter=lfs diff=lfs merge=lfs -text
58
  corpus/iob/train.iob filter=lfs diff=lfs merge=lfs -text
 
 
56
  corpus/iob/dev.iob filter=lfs diff=lfs merge=lfs -text
57
  corpus/iob/test.iob filter=lfs diff=lfs merge=lfs -text
58
  corpus/iob/train.iob filter=lfs diff=lfs merge=lfs -text
59
+ *.iob filter=lfs diff=lfs merge=lfs -text
tlunified-ner.py CHANGED
@@ -7,8 +7,9 @@ logger = datasets.logging.get_logger(__name__)
7
 
8
  _DESCRIPTION = """"""
9
  _LICENSE = """GNU GPL v3.0"""
 
10
  _CLASSES = ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC"]
11
- _VERSION = "1.0"
12
 
13
 
14
  class TLUnifiedNERConfig(datasets.BuilderConfig):
@@ -21,7 +22,7 @@ class TLUnifiedNER(datasets.GeneratorBasedBuilder):
21
 
22
  VERSION = datasets.Version(_VERSION)
23
 
24
- def _info() -> "datasets.DatasetInfo":
25
  return datasets.DatasetInfo(
26
  description=_DESCRIPTION,
27
  features=datasets.Features(
@@ -29,10 +30,11 @@ class TLUnifiedNER(datasets.GeneratorBasedBuilder):
29
  "id": datasets.Value("string"),
30
  "tokens": datasets.Sequence(datasets.Value("string")),
31
  "ner_tags": datasets.Sequence(
32
- datasets.feature.ClassLabel(names=_CLASSES)
33
  ),
34
  }
35
  ),
 
36
  supervised_keys=None,
37
  )
38
 
@@ -42,11 +44,10 @@ class TLUnifiedNER(datasets.GeneratorBasedBuilder):
42
  """Return a list of SplitGenerators that organizes the splits."""
43
  # The file extracts into {train,dev,test}.spacy files. The _generate_examples function
44
  # below will define how these files are parsed.
45
- corpus_dir = "corpus/iob"
46
  data_files = {
47
- "train": os.path.join(corpus_dir, "train.iob"),
48
- "dev": os.path.join(corpus_dir, "dev.iob"),
49
- "test": os.path.join(corpus_dir, "test.iob"),
50
  }
51
 
52
  return [
 
7
 
8
  _DESCRIPTION = """"""
9
  _LICENSE = """GNU GPL v3.0"""
10
+ _URL = "https://huggingface.co/ljvmiranda921/tlunified-ner"
11
  _CLASSES = ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC"]
12
+ _VERSION = "1.0.0"
13
 
14
 
15
  class TLUnifiedNERConfig(datasets.BuilderConfig):
 
22
 
23
  VERSION = datasets.Version(_VERSION)
24
 
25
+ def _info(self) -> "datasets.DatasetInfo":
26
  return datasets.DatasetInfo(
27
  description=_DESCRIPTION,
28
  features=datasets.Features(
 
30
  "id": datasets.Value("string"),
31
  "tokens": datasets.Sequence(datasets.Value("string")),
32
  "ner_tags": datasets.Sequence(
33
+ datasets.features.ClassLabel(names=_CLASSES)
34
  ),
35
  }
36
  ),
37
+ homepage=_URL,
38
  supervised_keys=None,
39
  )
40
 
 
44
  """Return a list of SplitGenerators that organizes the splits."""
45
  # The file extracts into {train,dev,test}.spacy files. The _generate_examples function
46
  # below will define how these files are parsed.
 
47
  data_files = {
48
+ "train": dl_manager.download_and_extract("corpus/iob/train.iob"),
49
+ "dev": dl_manager.download_and_extract("corpus/iob/dev.iob"),
50
+ "test": dl_manager.download_and_extract("corpus/iob/test.iob"),
51
  }
52
 
53
  return [