Upload 7 files
Browse files- csl_title_dev.json +0 -0
- csl_title_test.json +0 -0
- csl_title_train.json +0 -0
- test.tsv +0 -0
- train.tsv +0 -0
- trans.ipynb +54 -0
- val.tsv +0 -0
csl_title_dev.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
csl_title_test.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
csl_title_train.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
test.tsv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
train.tsv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
trans.ipynb
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": 1,
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"outputs": [],
|
| 8 |
+
"source": [
|
| 9 |
+
"import json\n",
|
| 10 |
+
"\n",
|
| 11 |
+
"def trans_tsv(filename):\n",
|
| 12 |
+
" res = []\n",
|
| 13 |
+
" with open(f'./{filename}.tsv', 'r', encoding='utf-8') as f:\n",
|
| 14 |
+
" for l in f.readlines():\n",
|
| 15 |
+
" title, content = l.split('\\t')\n",
|
| 16 |
+
" title, content = title.strip(), content.strip()\n",
|
| 17 |
+
" res.append(json.dumps({'title': title, 'abst': content}, ensure_ascii=False) + '\\n')\n",
|
| 18 |
+
" with open(f'./csl_title_{filename}.json', 'w', encoding='utf-8') as f:\n",
|
| 19 |
+
" f.writelines(res)\n",
|
| 20 |
+
"\n",
|
| 21 |
+
"trans_tsv('val')\n",
|
| 22 |
+
"trans_tsv('train')\n",
|
| 23 |
+
"trans_tsv('test')"
|
| 24 |
+
]
|
| 25 |
+
}
|
| 26 |
+
],
|
| 27 |
+
"metadata": {
|
| 28 |
+
"kernelspec": {
|
| 29 |
+
"display_name": "Python 3.8.8 ('base')",
|
| 30 |
+
"language": "python",
|
| 31 |
+
"name": "python3"
|
| 32 |
+
},
|
| 33 |
+
"language_info": {
|
| 34 |
+
"codemirror_mode": {
|
| 35 |
+
"name": "ipython",
|
| 36 |
+
"version": 3
|
| 37 |
+
},
|
| 38 |
+
"file_extension": ".py",
|
| 39 |
+
"mimetype": "text/x-python",
|
| 40 |
+
"name": "python",
|
| 41 |
+
"nbconvert_exporter": "python",
|
| 42 |
+
"pygments_lexer": "ipython3",
|
| 43 |
+
"version": "3.8.8"
|
| 44 |
+
},
|
| 45 |
+
"orig_nbformat": 4,
|
| 46 |
+
"vscode": {
|
| 47 |
+
"interpreter": {
|
| 48 |
+
"hash": "e42634819b8c191a5d07eaf23810ff32516dd8d3875f28ec3e488928fbd3c187"
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
},
|
| 52 |
+
"nbformat": 4,
|
| 53 |
+
"nbformat_minor": 2
|
| 54 |
+
}
|
val.tsv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|