pszemraj commited on
Commit
28b99d1
1 Parent(s): b987b99

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -2
README.md CHANGED
@@ -30,7 +30,41 @@ dataset_info:
30
  num_examples: 5954
31
  download_size: 152635605
32
  dataset_size: 261322043
 
 
 
33
  ---
34
- # Dataset Card for "simple_wikiedia_LM"
35
 
36
- [More Information needed](https://github.com/huggingface/datasets/blob/main/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  num_examples: 5954
31
  download_size: 152635605
32
  dataset_size: 261322043
33
+ license: apache-2.0
34
+ language:
35
+ - en
36
  ---
37
+ # Dataset Card for "simple_wikipedia_LM"
38
 
39
+
40
+
41
+ ```python
42
+ import re
43
+
44
+
45
+ def split_on_headings(text):
46
+ headings = ["References", "Related pages", "Other websites", "Further reading"]
47
+
48
+ for heading in headings:
49
+
50
+ parts = re.split(
51
+ r"^\s*" + re.escape(heading) + r".*$", text, flags=re.MULTILINE
52
+ )
53
+
54
+ if len(parts) > 1:
55
+ return parts[0].strip()
56
+
57
+ return text
58
+
59
+
60
+ text = """
61
+ Central Zazaki is a dialect of the Zazaki language. It is spoken in Eastern Anatolia Region of Turkey.
62
+ Related pages
63
+ Zazaki
64
+ Central Anatolia Region
65
+ Other websites
66
+ example.com
67
+ """
68
+
69
+ print(split_on_headings(text))
70
+ ```