Upload 2 files
Browse files- emoji/kajiwoto.txt.gz +3 -0
- emoji/tmp_b_emoji.py +20 -0
emoji/kajiwoto.txt.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f7d6da70d31990a1d3c82707029af5a8a01faf883ffab3d58d2a392358416c7a
|
3 |
+
size 2143344
|
emoji/tmp_b_emoji.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import emoji
|
2 |
+
# emoji.emoji_count("😬😍😻😘😚😽") == 6
|
3 |
+
import json
|
4 |
+
with open(r'E:\tmp\kajiwoto_sharegpt-len_gt_6-upvotes_gt_0-sampled.json', encoding='utf-8') as f:
|
5 |
+
tmp = json.load(f)
|
6 |
+
|
7 |
+
sc = []
|
8 |
+
for conversations in tmp:
|
9 |
+
conversations = conversations['conversations']
|
10 |
+
cc = []
|
11 |
+
ss = False
|
12 |
+
for conversation in conversations:
|
13 |
+
cc.append(conversation['from'] + ':' + conversation['value'].replace('\n', '\\n'))
|
14 |
+
if conversation['from'] == 'gpt' and emoji.emoji_count(conversation['value']) > 0:
|
15 |
+
ss = True
|
16 |
+
if ss:
|
17 |
+
sc.extend(cc)
|
18 |
+
|
19 |
+
with open(r'D:\datasets\b-corpus\emoji\kajiwoto.txt', 'w', encoding='utf-8') as f:
|
20 |
+
f.write('\n'.join(sc))
|