winobes commited on
Commit
83146a0
·
1 Parent(s): 48b11ee

integrate source lists

Browse files
Files changed (2) hide show
  1. README.md +3 -14
  2. open-riksdag.py +2 -5
README.md CHANGED
@@ -65,22 +65,11 @@ The focus of this huggingface dataset is to organise the data for fine-grained d
65
  - data includes: date, document_type, document_id, target_word, and text.
66
 
67
  The dataset builder requires a `years` argument, which must be an interable of years between 1979 and 2019 (inclusive). This can be supplied to the `load_dataset` function as a keyword argument.
68
- For example, to load all of the data:
69
 
70
  ```python
71
  from datasets import load_dataset
72
- data = load_dataset('ChangeIsKey/openRD-103', years=range(1979,2020))
73
  ```
74
 
75
- The data can take some time to load/extract. Using [dataset streaming](https://huggingface.co/docs/datasets/stream) may be an option. Size of data by decade can be found below:
76
-
77
- | | bytes | sentences | tokens |
78
- |-------|-------|-----------|--------|
79
- | 1979 | 118Mb | 0.409M | 10M |
80
- | 1980s | 1.4Gb | 4.7M | 118M |
81
- | 1990s | 2.2Gb | 5.3M | 202M |
82
- | 2000s | 4.0Gb | 11.8M | 338M |
83
- | 2010s | 4.4Gb | 14.1M | 361M |
84
- | total | 13Gb | 36.9M | 279M |
85
-
86
- License is CC BY 4.0 with attribution.
 
65
  - data includes: date, document_type, document_id, target_word, and text.
66
 
67
  The dataset builder requires a `years` argument, which must be an interable of years between 1979 and 2019 (inclusive). This can be supplied to the `load_dataset` function as a keyword argument.
68
+ For example, to load raw sentences from the `prop` and `bet` data sources run:
69
 
70
  ```python
71
  from datasets import load_dataset
72
+ data = load_dataset('ChangeIsKey/open-riksdag', 'sentences' years=range(1999,2000), sources=['prop', 'bet'])
73
  ```
74
 
75
+ License is CC BY 4.0 with attribution.
 
 
 
 
 
 
 
 
 
 
 
open-riksdag.py CHANGED
@@ -60,12 +60,9 @@ In a nutshell, this version offers:
60
  License is CC BY 4.0 with attribution.
61
  """
62
 
63
- _CONFIGS = ['sentences', 'target-103']
64
  _ALL_YEARS = list(range(1979, 2020))
65
- with open("data_sources.txt") as f:
66
- _ALL_SOURCES = f.read().strip().split(' ')
67
- with open("target_terms.txt") as f:
68
- _ALL_TARGET_TERMS = f.read().strip().split(' ')
69
  _TERM_TO_ID = {t: i for i,t in enumerate(_ALL_TARGET_TERMS)}
70
 
71
  class OpenRiksdagConfig(datasets.BuilderConfig):
 
60
  License is CC BY 4.0 with attribution.
61
  """
62
 
 
63
  _ALL_YEARS = list(range(1979, 2020))
64
+ _ALL_SOURCES = ['bet', 'ds', 'eun', 'flista', 'fpm', 'frsrdg', 'ip', 'kammakt', 'kom', 'mot', 'ovr', 'prop', 'prot', 'rskr', 'samtr', 'skfr', 'sou', 'tlista', 'utr', 'utsk', 'yttr']
65
+ _ALL_TARGET_TERMS = ['%', 'april', 'arbetsförmedling', 'arbetsgivare', 'arbetslöshet', 'arbetsmarknad', 'arbetsmarknadsminister', 'augusti', 'barn', 'betala', 'bil', 'bolag', 'bostad', 'brott', 'december', 'drabba', 'ekonomisk', 'elev', 'februari', 'finansminister', 'flicka', 'flygplats', 'forskning', 'fru', 'företag', 'försvarsmakt', 'försvarsminister', 'försäkringskassa', 'förälder', 'gammal', 'grupp', 'herr', 'hälsa', 'högskola', 'internationell', 'isolering', 'januari', 'jobb', 'juli', 'juni', 'justitieminister', 'kommun', 'kommunal', 'kostnad', 'krona', 'kultur', 'kunskap', 'kvinna', 'lag', 'lagstiftning', 'landsbygd', 'landsting', 'lokal', 'län', 'lärare', 'm', 'maj', 'man', 'mars', 'migrationsminister', 'miljard', 'miljon', 'miljö', 'miljöminister', 'myndighet', 'mänsklig', 'mål', 'nationell', 'ni', 'november', 'näringsminister', 'offentlig', 'oktober', 'organisation', 'ovanstående', 'person', 'polis', 'procent', 'rapport', 'regel', 'region', 'rättighet', 'september', 'sjukvård', 'skatt', 'socialminister', 'stat', 'statlig', 'statsminister', 'statsråd', 'student', 'stöd', 'trafikverk', 'ung', 'ungdom', 'utbildning', 'utbildningsminister', 'utredning', 'utrikesminister', 'verksamhet', 'våld', 'vård', 'återtagen']
 
 
66
  _TERM_TO_ID = {t: i for i,t in enumerate(_ALL_TARGET_TERMS)}
67
 
68
  class OpenRiksdagConfig(datasets.BuilderConfig):