Update README.md
Browse files
README.md
CHANGED
@@ -11,7 +11,6 @@ language:
|
|
11 |
|
12 |
### Dataset Description
|
13 |
|
14 |
-
<!-- Provide a longer summary of what this dataset is. -->
|
15 |
|
16 |
A curated list of abbreviations commonly used in text messages and gaming chat and other places. We have tried to remove explanations and explicitly put a full expansion of the abbreviation.
|
17 |
Be careful - some items are whole words already.
|
@@ -27,15 +26,20 @@ Be careful - some items are whole words already.
|
|
27 |
Use as a training set for abbreviations or as part of a GEC task
|
28 |
|
29 |
```python
|
30 |
-
import csv
|
31 |
# Load abbreviations and their expansions from sms.csv into a dictionary
|
32 |
abbreviations_dict = {}
|
33 |
with open('sms.csv', mode='r', encoding='utf-8') as infile:
|
34 |
-
# Specify the delimiter as a tab character
|
35 |
reader = csv.reader(infile, delimiter=',')
|
|
|
36 |
for row in reader:
|
37 |
-
if len(row) >=
|
38 |
-
|
|
|
|
|
|
|
39 |
else:
|
40 |
print(f"Skipping malformed row: {row}")
|
|
|
|
|
41 |
```
|
|
|
11 |
|
12 |
### Dataset Description
|
13 |
|
|
|
14 |
|
15 |
A curated list of abbreviations commonly used in text messages and gaming chat and other places. We have tried to remove explanations and explicitly put a full expansion of the abbreviation.
|
16 |
Be careful - some items are whole words already.
|
|
|
26 |
Use as a training set for abbreviations or as part of a GEC task
|
27 |
|
28 |
```python
|
29 |
+
import csv
|
30 |
# Load abbreviations and their expansions from sms.csv into a dictionary
|
31 |
abbreviations_dict = {}
|
32 |
with open('sms.csv', mode='r', encoding='utf-8') as infile:
|
|
|
33 |
reader = csv.reader(infile, delimiter=',')
|
34 |
+
next(reader, None) # Skip the header if present
|
35 |
for row in reader:
|
36 |
+
if len(row) >= 3:
|
37 |
+
abbreviation = row[0].strip().upper()
|
38 |
+
expansion = row[1].strip()
|
39 |
+
is_word = row[2].strip().lower() in ['true', 'yes', '1'] # Convert to boolean
|
40 |
+
abbreviations_dict[abbreviation] = (expansion, is_word)
|
41 |
else:
|
42 |
print(f"Skipping malformed row: {row}")
|
43 |
+
|
44 |
+
|
45 |
```
|