Kriyans commited on
Commit
51698b5
1 Parent(s): e4f92e6

Update ner.py

Browse files
Files changed (1) hide show
  1. ner.py +10 -3
ner.py CHANGED
@@ -2,7 +2,10 @@ import datasets
2
 
3
  logger = datasets.logging.get_logger(__name__)
4
 
5
- _URL = "https://raw.githubusercontent.com/Kriyansparsana/demorepo/main/train.txt"
 
 
 
6
 
7
  class indian_namesConfig(datasets.BuilderConfig):
8
  """The WNUT 17 Emerging Entities Dataset."""
@@ -36,7 +39,7 @@ class indian_names(datasets.GeneratorBasedBuilder):
36
  "B-corporation",
37
  "I-corporation",
38
  "B-person",
39
- "I-person"
40
  ]
41
  )
42
  ),
@@ -48,12 +51,16 @@ class indian_names(datasets.GeneratorBasedBuilder):
48
  def _split_generators(self, dl_manager):
49
  """Returns SplitGenerators."""
50
  urls_to_download = {
51
- "train": f"{_URL}",
 
 
52
  }
53
  downloaded_files = dl_manager.download_and_extract(urls_to_download)
54
 
55
  return [
56
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
 
 
57
  ]
58
 
59
  def _generate_examples(self, filepath):
 
2
 
3
  logger = datasets.logging.get_logger(__name__)
4
 
5
+ _URL = "https://raw.githubusercontent.com/Kriyansparsana/demorepo/main/"
6
+ _TRAINING_FILE = "wnut17train%20(1).conll"
7
+ _DEV_FILE = "indian_ner_dev.conll"
8
+ _TEST_FILE = "indian_ner_test.conll"
9
 
10
  class indian_namesConfig(datasets.BuilderConfig):
11
  """The WNUT 17 Emerging Entities Dataset."""
 
39
  "B-corporation",
40
  "I-corporation",
41
  "B-person",
42
+ "I-person",
43
  ]
44
  )
45
  ),
 
51
  def _split_generators(self, dl_manager):
52
  """Returns SplitGenerators."""
53
  urls_to_download = {
54
+ "train": f"{_URL}{_TRAINING_FILE}",
55
+ "dev": f"{_URL}{_DEV_FILE}",
56
+ "test": f"{_URL}{_TEST_FILE}",
57
  }
58
  downloaded_files = dl_manager.download_and_extract(urls_to_download)
59
 
60
  return [
61
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
62
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
63
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
64
  ]
65
 
66
  def _generate_examples(self, filepath):