qgyd2021 commited on
Commit
d3d09b9
·
1 Parent(s): 8cbe332
Files changed (2) hide show
  1. README.md +66 -6
  2. main.py +4 -3
README.md CHANGED
@@ -24,8 +24,7 @@ license: apache-2.0
24
 
25
  <details>
26
  <summary>email_spam 样本示例</summary>
27
- <pre><code>
28
- ------------
29
  Subject: photoshop , windows , office . cheap . main trending
30
  abasements darer prudently fortuitous undergone
31
  lighthearted charm orinoco taster
@@ -64,8 +63,7 @@ ham
64
 
65
  <details>
66
  <summary>enron_spam 样本示例</summary>
67
- <pre><code>
68
- ------------
69
  wanted to try ci 4 lis but thought it was way too expensive for you ?
70
  <br>
71
  viagra at $ 1 . 12 per dose
@@ -146,8 +144,7 @@ spam
146
 
147
  <details>
148
  <summary>spam_assassin 样本示例</summary>
149
- <pre><code>
150
- ------------
151
  "\n>>>Robert Elz said:\n > Date: Wed, 28 Aug 2002 09:22:34 -0500\n > From: Chris Garrigues <[email protected]\nm>\n > Message-ID: <[email protected]>\n > \n > \n > | so I'll probably poke around at the sequences performance issues,\n > \n > Well, there's this wonderful piece of code in MhSeqExpand ...\n > \n > # Hack to weed out sequence numbers for messages that don't exist\n > foreach m $rseq {\n > if ![file exists $mhProfile(path)/$folder/$m] {\n > Exmh_Debug $mhProfile(path)/$folder/$m not found\n > set ix [lsearch $seq $m]\n > set seq [lreplace $seq $ix $ix]\n > } else {\n > # Real hack\n\nAt least I'm up-front about my hacks :-)\n\n > break\n > }\n > }\n > \n > which is going to run slow if a sequence happens to start with a bunch\n > of messages that don't exist. I'm not sure why it is important that the\n > first message in the sequence returned exists, but not necessarily any\n > of the others, but I'm sure glad it is, as MhSeqExpand gets called lots,\n > and I don't know if I could cope if it were checking every file in the\n > sequences it is looking at, all the time...\n\nThat was my thinking. My recollection about the first message being valid\nis that the ftoc code wants to find that message to start its highlighting,\nfor example, or you are selecting a message to display.\n\n > It may help to keep a list of the valid message numbers for the current\n > folder (though that would then need to be verified against changes to the\n > directory). Does tcl have a directory read function? I assume so...\n\nglob -nocomplain $mhProfile(path)/$folder *\nwill return an unsorted list of the directory's contents.\nBut the thought of keeping an in memory list of valid messages is not fun.\nExmh already maintains in-core lists of messages in sequences, which is\nalready pretty tricky\n\n > Mh_Sequence also goes and rereads the files (.mh_sequences and the\n > context file) but I'm not sure how frequently that one is called.\n\nIn some places I maintain caches of files by checking their modify time,\nbut the sequence files are soo small that by the time you stat them to\ncheck their date stamp, you could just read them again. Also, now that\nwe checkpoint message state on every message view, that file will change\nevery time. In the old days exmh used to cache a bunch of state about\nthe folder.\n\n--\nBrent Welch\nSoftware Architect, Panasas Inc\nPioneering the World's Most Scalable and Agile Storage Network\nwww.panasas.com\[email protected]\n\n\n\n\n_______________________________________________\nExmh-workers mailing list\[email protected]\nhttps://listman.redhat.com/mailman/listinfo/exmh-workers\n\n"
152
  spam
153
  ------------
@@ -164,6 +161,69 @@ ham
164
  </details>
165
 
166
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  ### 参考来源
168
 
169
  <details>
 
24
 
25
  <details>
26
  <summary>email_spam 样本示例</summary>
27
+ <pre><code>------------
 
28
  Subject: photoshop , windows , office . cheap . main trending
29
  abasements darer prudently fortuitous undergone
30
  lighthearted charm orinoco taster
 
63
 
64
  <details>
65
  <summary>enron_spam 样本示例</summary>
66
+ <pre><code>------------
 
67
  wanted to try ci 4 lis but thought it was way too expensive for you ?
68
  <br>
69
  viagra at $ 1 . 12 per dose
 
144
 
145
  <details>
146
  <summary>spam_assassin 样本示例</summary>
147
+ <pre><code>------------
 
148
  "\n>>>Robert Elz said:\n > Date: Wed, 28 Aug 2002 09:22:34 -0500\n > From: Chris Garrigues <[email protected]\nm>\n > Message-ID: <[email protected]>\n > \n > \n > | so I'll probably poke around at the sequences performance issues,\n > \n > Well, there's this wonderful piece of code in MhSeqExpand ...\n > \n > # Hack to weed out sequence numbers for messages that don't exist\n > foreach m $rseq {\n > if ![file exists $mhProfile(path)/$folder/$m] {\n > Exmh_Debug $mhProfile(path)/$folder/$m not found\n > set ix [lsearch $seq $m]\n > set seq [lreplace $seq $ix $ix]\n > } else {\n > # Real hack\n\nAt least I'm up-front about my hacks :-)\n\n > break\n > }\n > }\n > \n > which is going to run slow if a sequence happens to start with a bunch\n > of messages that don't exist. I'm not sure why it is important that the\n > first message in the sequence returned exists, but not necessarily any\n > of the others, but I'm sure glad it is, as MhSeqExpand gets called lots,\n > and I don't know if I could cope if it were checking every file in the\n > sequences it is looking at, all the time...\n\nThat was my thinking. My recollection about the first message being valid\nis that the ftoc code wants to find that message to start its highlighting,\nfor example, or you are selecting a message to display.\n\n > It may help to keep a list of the valid message numbers for the current\n > folder (though that would then need to be verified against changes to the\n > directory). Does tcl have a directory read function? I assume so...\n\nglob -nocomplain $mhProfile(path)/$folder *\nwill return an unsorted list of the directory's contents.\nBut the thought of keeping an in memory list of valid messages is not fun.\nExmh already maintains in-core lists of messages in sequences, which is\nalready pretty tricky\n\n > Mh_Sequence also goes and rereads the files (.mh_sequences and the\n > context file) but I'm not sure how frequently that one is called.\n\nIn some places I maintain caches of files by checking their modify time,\nbut the sequence files are soo small that by the time you stat them to\ncheck their date stamp, you could just read them again. Also, now that\nwe checkpoint message state on every message view, that file will change\nevery time. In the old days exmh used to cache a bunch of state about\nthe folder.\n\n--\nBrent Welch\nSoftware Architect, Panasas Inc\nPioneering the World's Most Scalable and Agile Storage Network\nwww.panasas.com\[email protected]\n\n\n\n\n_______________________________________________\nExmh-workers mailing list\[email protected]\nhttps://listman.redhat.com/mailman/listinfo/exmh-workers\n\n"
149
  spam
150
  ------------
 
161
  </details>
162
 
163
 
164
+ <details>
165
+ <summary>spam_detection 样本示例</summary>
166
+ <pre><code>------------
167
+ Looking for an epic way to boost your followers? Want to increase your likes? Well, listen up! Our site has the ultimate solution for you! With our automated system, you can get hundreds of followers in seconds! Not only that, but our team of social media experts will also provide you with the latest and greatest tips and tricks to make your page go viral! Don't wait, join the millions of successful users who have already transformed their social media game with our help!
168
+ <br>
169
+ spam
170
+ ------------
171
+ I'm working on a bayesian network to genetare synthetic WIM observations such as gross vehicle weight, total vehicle length, individual axle load and inter axle distances. It will be very helpful to have data sets for different sites. Thanks
172
+ ham
173
+ ------------
174
+ Hey, check out these amazing deals just for you! 🎁🎉
175
+ <br>
176
+ 💰 Get rich quick! Click here to learn how! 💰
177
+ <br>
178
+ 😍 Need a date? We've got you covered! Join our dating site now! 😍
179
+ <br>
180
+ 🔥 Burn fat fast with our miracle pill! Guaranteed results! 🔥
181
+ <br>
182
+ 👀 Want to see what everyone's talking about? Click here for the latest viral videos! 👀
183
+ <br>
184
+ 🤑 Don't miss out on our exclusive discount codes! Shop now and save big! 🤑
185
+ <br>
186
+ 🌈 Feeling lucky? Enter our sweepstakes for
187
+ spam
188
+ ------------
189
+ Looking for a dataset with the latest Omicron covid variant data and confirmed locations. Any links would be appreciated, thanks!
190
+ ham
191
+ ------------
192
+ </code></pre>
193
+ </details>
194
+
195
+
196
+ <details>
197
+ <summary>spam_message 样本示例</summary>
198
+ <pre><code>------------
199
+ 欣彩印刷厂主营彩盒.吊牌.产品说明书及提供四色印刷对外加工.电话xxxxxxxxxxx米先生
200
+ spam
201
+ ------------
202
+ 微软称Windows10是“有史以来最安全的Windows版本”
203
+ ham
204
+ ------------
205
+ 您好!欢迎致电川中意货运有限公司,本公司承接成都至恩施,武汉至恩施及周边县市,覆射全国各地的整车、零担往返运输业务。我们以“信誉第一,
206
+ spam
207
+ ------------
208
+ 我用了9个月时间学会在医院的时候自己照顾自己这件事情
209
+ ham
210
+ ------------
211
+ 在元宵节到来之际
212
+ spam
213
+ ------------
214
+ 丰县大队要求各中队加强日常执勤
215
+ ham
216
+ ------------
217
+ 欢迎致电开锁王。本公司公安备案,工商注册。经营范围:汽车锁,保险柜,防盗门及各种民用锁芯升级!联系电话xxxx-xxxxxxx
218
+ spam
219
+ ------------
220
+ 扬州天姿现在基本也留不住高端顾客群体了
221
+ ham
222
+ ------------
223
+ </code></pre>
224
+ </details>
225
+
226
+
227
  ### 参考来源
228
 
229
  <details>
main.py CHANGED
@@ -8,8 +8,9 @@ dataset = load_dataset(
8
  # name="email_spam",
9
  # name="enron_spam",
10
  # name="sms_spam",
11
- name="spam_assassin",
12
  # name="spam_detection",
 
13
  split="train",
14
  cache_dir=None,
15
  download_mode=DownloadMode.FORCE_REDOWNLOAD
@@ -19,8 +20,8 @@ for sample in dataset:
19
  text = sample["text"]
20
  label = sample["label"]
21
 
22
- if label == "spam":
23
- continue
24
  print(text)
25
  print(label)
26
  print("-" * 12)
 
8
  # name="email_spam",
9
  # name="enron_spam",
10
  # name="sms_spam",
11
+ # name="spam_assassin",
12
  # name="spam_detection",
13
+ name="spam_message",
14
  split="train",
15
  cache_dir=None,
16
  download_mode=DownloadMode.FORCE_REDOWNLOAD
 
20
  text = sample["text"]
21
  label = sample["label"]
22
 
23
+ # if label == "spam":
24
+ # continue
25
  print(text)
26
  print(label)
27
  print("-" * 12)