Datasets:

Modalities:
Text
Formats:
json
Languages:
Norwegian
ArXiv:
Libraries:
Datasets
pandas
License:
pere commited on
Commit
e42d83f
1 Parent(s): 4fe6f67
Files changed (4) hide show
  1. data/dev.tsv +0 -0
  2. data/test.tsv +0 -0
  3. data/train.tsv +0 -0
  4. norwegian_parliament.py +9 -9
data/dev.tsv ADDED
The diff for this file is too large to render. See raw diff
 
data/test.tsv ADDED
The diff for this file is too large to render. See raw diff
 
data/train.tsv ADDED
The diff for this file is too large to render. See raw diff
 
norwegian_parliament.py CHANGED
@@ -19,11 +19,11 @@ of the two major parties: Fremskrittspartiet and Sosialistisk Venstreparti.
19
 
20
  _HOMEPAGE = "https://github.com/NBAiLab/notram/"
21
 
22
- _BASE_URL = "https://huggingface.co/datasets/NbAiLab/norwegian_parliament/blob/main/data/"
23
  _URLS = {
24
- "train": f"{_BASE_URL}train.csv",
25
- "dev": f"{_BASE_URL}dev.csv",
26
- "test": f"{_BASE_URL}test.csv",
27
  }
28
 
29
  class NorwegianParliament(datasets.GeneratorBasedBuilder):
@@ -55,13 +55,13 @@ class NorwegianParliament(datasets.GeneratorBasedBuilder):
55
  ]
56
 
57
  def _generate_examples(self, filepath):
58
- with open(filepath, encoding="utf-8") as csv_file:
59
- csv_reader = csv.reader(csv_file, delimiter=",")
60
- next(csv_reader) # Skip the header
61
- for idx, row in enumerate(csv_reader):
62
  index, text, label, date = row
63
  yield idx, {
64
- "text": text.strip('"'), # Remove surrounding quotes if necessary
65
  "label": label,
66
  "date": date,
67
  }
 
19
 
20
  _HOMEPAGE = "https://github.com/NBAiLab/notram/"
21
 
22
+ _BASE_URL = "https://raw.githubusercontent.com/your-username/your-repo/main/data/"
23
  _URLS = {
24
+ "train": f"{_BASE_URL}train.tsv",
25
+ "dev": f"{_BASE_URL}dev.tsv",
26
+ "test": f"{_BASE_URL}test.tsv",
27
  }
28
 
29
  class NorwegianParliament(datasets.GeneratorBasedBuilder):
 
55
  ]
56
 
57
  def _generate_examples(self, filepath):
58
+ with open(filepath, encoding="utf-8") as file:
59
+ reader = csv.reader(file, delimiter="\t") # Use tab delimiter for TSV files
60
+ next(reader) # Skip the header
61
+ for idx, row in enumerate(reader):
62
  index, text, label, date = row
63
  yield idx, {
64
+ "text": text,
65
  "label": label,
66
  "date": date,
67
  }