ticoAg commited on
Commit
dfe9044
·
verified ·
1 Parent(s): f0d6817

Upload 2 files

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +45 -0
  3. data/data.jsonl +3 -0
.gitattributes CHANGED
@@ -53,3 +53,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
56
+ data/data.jsonl filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Note
2
+
3
+ ## 预处理方式
4
+
5
+ ```python
6
+ from datasets import load_dataset
7
+ import jsonlines
8
+ import matplotlib.pyplot as plt
9
+
10
+ ds_ruozhiba = load_dataset("kirp/wisdomBar")
11
+
12
+ _data = []
13
+ for item in ds_ruozhiba["train"]:
14
+ instruct = item["title"] if item["detail"] is None else item["title"] + ("," if item["title"][-1] not in [",", ",","。", ".", "!", "!", "?", "?"] else "") + item["detail"]
15
+ if instruct:
16
+ _data.append(instruct)
17
+ _data_to_dump = [[{"from": "human", "value": value}] for value in _data]
18
+
19
+ with jsonlines.open('ruozhiba/ruozhiba.jsonl', mode='w') as writer:
20
+ writer.write_all(_data_to_dump)
21
+
22
+ def string_length_distribution(strings, step=10, gate_coef=0.005):
23
+ distribution = {i: 0 for i in range(0, 100)}
24
+ for string in strings:
25
+ length = len(string)
26
+ distribution[length // step] += 1
27
+ distribution = {
28
+ f"{k*step}-{(k+1)*step}": v for k, v in distribution.items() if v > gate_coef * max(distribution.values())
29
+ }
30
+ return distribution
31
+
32
+
33
+ dist = string_length_distribution(_data)
34
+
35
+ plt.bar(list(dist.keys()), list(dist.values()))
36
+ plt.xlabel("String Length")
37
+ plt.ylabel("Count")
38
+ plt.title("String Length Distribution")
39
+ plt.show()
40
+ ```
41
+
42
+ 注意事项:
43
+
44
+ - 拼接方式不是完全合理,部分 title 是初始问题或者梗,detail 部分是答案,部分是梗的进一步补充(语义上并列的同义表述/进一步的阐述),因此需要根据实际情况进行调整.
45
+ - 当前暂不对所属细分的处理方式单独处理,统一将拼接后的内容作为 human 的输入.
data/data.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8403e3de3c8b06b85fbba0e678bc6a92ffcc2de476a211c5ba28ca51f32a3798
3
+ size 13655939