Kriyans commited on
Commit
879ee4f
1 Parent(s): fc52e82

Update indian_names.py

Browse files
Files changed (1) hide show
  1. indian_names.py +0 -40
indian_names.py CHANGED
@@ -58,46 +58,6 @@ class indian_names(datasets.GeneratorBasedBuilder):
58
  return [
59
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
60
  ]
61
-
62
- # def _generate_examples(self, filepath):
63
- # logger.info("⏳ Generating examples from = %s", filepath)
64
- # with open(filepath, encoding="utf-8") as f:
65
- # current_tokens = []
66
- # current_labels = []
67
- # sentence_counter = 0
68
- # for row in f:
69
- # row = row.rstrip()
70
- # if row:
71
- # # Check if the delimiter ("\t") is present in the row
72
- # if "\t" in row:
73
- # token, label = row.split("\t")
74
- # current_tokens.append(token)
75
- # current_labels.append(label)
76
- # else:
77
- # # New sentence
78
- # if not current_tokens:
79
- # # Consecutive empty lines will cause empty sentences
80
- # continue
81
- # assert len(current_tokens) == len(current_labels), "💔 between len of tokens & labels"
82
- # sentence = (
83
- # sentence_counter,
84
- # {
85
- # "id": str(sentence_counter),
86
- # "tokens": current_tokens,
87
- # "ner_tags": current_labels,
88
- # },
89
- # )
90
- # sentence_counter += 1
91
- # current_tokens = []
92
- # current_labels = []
93
- # yield sentence
94
- # # Don't forget the last sentence in the dataset 🧐
95
- # if current_tokens:
96
- # yield sentence_counter, {
97
- # "id": str(sentence_counter),
98
- # "tokens": current_tokens,
99
- # "ner_tags": current_labels,
100
- # }
101
 
102
  def _generate_examples(self, filepath):
103
  logger.info("⏳ Generating examples from = %s", filepath)
 
58
  return [
59
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
60
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  def _generate_examples(self, filepath):
63
  logger.info("⏳ Generating examples from = %s", filepath)