asahi417 commited on
Commit
fd016cb
1 Parent(s): 36baa0d
Files changed (1) hide show
  1. process/unify_sp_symbol.py +12 -12
process/unify_sp_symbol.py CHANGED
@@ -30,15 +30,15 @@ from glob import glob
30
  # with open(i, "w") as f:
31
  # f.write("\n".join([json.dumps(j) for j in data]))
32
 
33
- for i in glob("data/tweet_similarity/*.jsonl"):
34
- with open(i) as f:
35
- data = [json.loads(j) for j in f.readlines()]
36
- for d in data:
37
- for c in ['text_1', "text_2"]:
38
- tmp = d[c]
39
- # tmp = re.sub(r"(@[\S]+)\b", r"{\1@}", tmp)
40
- tmp = tmp.replace("{@user@}", "{{USERNAME}}")
41
- d[c] = tmp
42
-
43
- with open(i, "w") as f:
44
- f.write("\n".join([json.dumps(j) for j in data]))
 
30
  # with open(i, "w") as f:
31
  # f.write("\n".join([json.dumps(j) for j in data]))
32
 
33
+ # for i in glob("data/tweet_similarity/*.jsonl"):
34
+ # with open(i) as f:
35
+ # data = [json.loads(j) for j in f.readlines()]
36
+ # for d in data:
37
+ # for c in ['text_1', "text_2"]:
38
+ # tmp = d[c]
39
+ # # tmp = re.sub(r"(@[\S]+)\b", r"{\1@}", tmp)
40
+ # tmp = tmp.replace("{@user@}", "{{USERNAME}}")
41
+ # d[c] = tmp
42
+ #
43
+ # with open(i, "w") as f:
44
+ # f.write("\n".join([json.dumps(j) for j in data]))