【数据科学项目02】:NLP应用之垃圾短信/邮件检测(端到端的项目)

这篇具有很好参考价值的文章主要介绍了【数据科学项目02】:NLP应用之垃圾短信/邮件检测(端到端的项目)。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

垃圾短信检测(端到端的项目)

我们都听说过一个流行词——“数据科学”。我们大多数人都对“它是什么?我可以成为数据分析师或数据科学家吗?我需要什么技能?并不是很了解。例如:我想开始一个数据科学项目,但我却不知道如何着手进行。
我们大多数人都是通过一些在线课程了解了这个领域。我们对课程中布置的作业和项目感到游刃有余。但是,当开始分析全新或未知的数据集时,我们会迷失方向。为了在分析我们遇到的任何数据集和问题时,我们需要通过不断的练习。我觉得最好的方式之一就是在项目中进行学习。所以每个人都需要开始自己的第一个项目。因此,我准备写一个专栏,带大家一起完成数据科学项目,感兴趣的朋友可以一起交流学习。本专栏是一个以实战为主的专栏。

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

0.引言

随着产品和服务在线消费的增加,消费者面临着收件箱中大量垃圾邮件的巨大问题,这些垃圾邮件要么是基于促销的,要么是欺诈性的。由于这个原因,一些非常重要的消息/电子邮件被当做垃圾短信处理了。在本文中,我们将创建一个 垃圾短信/邮件检测模型,该模型将使用朴素贝叶斯和自然语言处理(NLP) 来确定是否为垃圾短信/邮件。

在这里我使用的是colab内置环境,完整代码文末获取。

额外的所需包如下,大家自行安装

nltk
streamlit
pickle

1.数据收集和加载

我们将使用kaggle提供的数据集:数据集

该数据集 包含一组带有标记的短信文本,这些消息被归类为正常短信垃圾短信。 每行包含一条消息。每行由两列组成:v1 带有标签,(spam 或 ham),v2 是文本内容。

df=pd.read_csv('/content/spam/spam.csv',encoding='latin-1')#这里encoding需要指定为latin-1
# 查看一下数据基本情况
df.head()
v1 v2 Unnamed: 2 Unnamed: 3 Unnamed: 4
0 ham Go until jurong point, crazy.. Available only ... NaN NaN NaN
1 ham Ok lar... Joking wif u oni... NaN NaN NaN
2 spam Free entry in 2 a wkly comp to win FA Cup fina... NaN NaN NaN
3 ham U dun say so early hor... U c already then say... NaN NaN NaN
4 ham Nah I don't think he goes to usf, he lives aro... NaN NaN NaN

该数据包含一组带有标记的短信数据,其中:

  • v1表示短信标签,ham表示正常信息,spam表示垃圾信息
  • v2是短信的内容
#去除不需要的列
df=df.iloc[:,:2]
#重命名列
df=df.rename(columns={"v1":"label","v2":"message"})
df.head()
label message
0 ham Go until jurong point, crazy.. Available only ...
1 ham Ok lar... Joking wif u oni...
2 spam Free entry in 2 a wkly comp to win FA Cup fina...
3 ham U dun say so early hor... U c already then say...
4 ham Nah I don't think he goes to usf, he lives aro...
# 将lable进行one-hot编码,其中0:ham,1:spam
from sklearn.preprocessing import LabelEncoder
encoder = LabelEncoder()
df['label']=encoder.fit_transform(df['label'])
df['label'].value_counts()
0    4825
1     747
Name: label, dtype: int64

可以看出一共有747个垃圾短信

# 查看缺失值
df.isnull().sum()
# 数据没有缺失值
label      0
message    0
dtype: int64

2.探索性数据分析(EDA)

通过可视化分析来更好的理解数据

import matplotlib.pyplot as plt
plt.style.use('ggplot')
plt.figure(figsize=(9,4))
plt.subplot(1,2,1)
plt.pie(df['label'].value_counts(),labels=['not spam','spam'],autopct="%0.2f")
plt.subplot(1,2,2)
sns.barplot(x=df['label'].value_counts().index,y=df['label'].value_counts(),data=df)
plt.show()

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

在特征工程部分,我简单创建了一些单独的特征来提取信息

  • 字符数
  • 单词数
  • 句子数
#1.字符数
df['char']=df['message'].apply(len)
nltk.download('punkt')
[nltk_data] Downloading package punkt to /root/nltk_data...
[nltk_data]   Unzipping tokenizers/punkt.zip.

True
#2.单词数,这里我们首先要对其进行分词处理,使用nltk
#分词处理
df['words']=df['message'].apply(lambda x: len(nltk.word_tokenize(x)))
# 3.句子数
df['sen']=df['message'].apply(lambda x: len(nltk.sent_tokenize(x)))
df.head()
label message char words sen
0 0 Go until jurong point, crazy.. Available only ... 111 24 2
1 0 Ok lar... Joking wif u oni... 29 8 2
2 1 Free entry in 2 a wkly comp to win FA Cup fina... 155 37 2
3 0 U dun say so early hor... U c already then say... 49 13 1
4 0 Nah I don't think he goes to usf, he lives aro... 61 15 1

描述性统计

# 描述性统计
df.describe()
index label char words sen
count 5572.0 5572.0 5572.0 5572.0
mean 0.13406317300789664 80.11880832735105 18.69562096195262 1.9707465900933239
std 0.34075075489776974 59.6908407765033 13.742586801744975 1.4177777134026657
min 0.0 2.0 1.0 1.0
25% 0.0 36.0 9.0 1.0
50% 0.0 61.0 15.0 1.0
75% 0.0 121.0 27.0 2.0
max 1.0 910.0 220.0 28.0

下面我们通过可视化比较一下不同短信在这些数字特征上的分布情况

# 字符数比较
plt.figure(figsize=(12,6))
sns.histplot(df[df['label']==0]['char'],color='red')#正常短信
sns.histplot(df[df['label']==1]['char'],color = 'blue')#垃圾短信
<matplotlib.axes._subplots.AxesSubplot at 0x7fce63763dd0>

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

# 比较
plt.figure(figsize=(12,6))
sns.histplot(df[df['label']==0]['words'],color='red')#正常短信
sns.histplot(df[df['label']==1]['words'],color = 'blue')#垃圾短信
<matplotlib.axes._subplots.AxesSubplot at 0x7fce63f4bed0>


nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

sns.pairplot(df,hue='label')

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

#删除数据集中存在的一些异常值
i=df[df['char']>500].index
df.drop(i,axis=0,inplace=True)
df=df.reset_index()
df.drop("index",inplace=True,axis=1)
#相关系数矩阵
sns.heatmap(df.corr(),annot=True)
<matplotlib.axes._subplots.AxesSubplot at 0x7fce606d0250>

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

我们这里看到存在多重共线性,因此,我们不使用所有的列,在这里选择与label相关性最强的char

3.数据预处理

对于英文文本数据,我们常用的数据预处理方式如下

  • 去除标点符号
  • 去除停用词
  • 去除专有名词
  • 变换成小写
  • 分词处理
  • 词根、词缀处理

下面我们来看看如何实现这些步骤

nltk.download('stopwords')
[nltk_data] Downloading package stopwords to /root/nltk_data...
[nltk_data]   Unzipping corpora/stopwords.zip.

True
# 首先导入需要使用到的包
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from wordcloud import WordCloud
import string,time
# 标点符号
string.punctuation
'!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
# 停用词
stopwords.words('english')

3.1清洗文本数据

  • 去除web链接
  • 去除邮件
  • 取掉数字

下面使用正则表达式来处理这些数据。

def remove_website_links(text):
    no_website_links = text.replace(r"http\S+", "")#去除网络连接
    return no_website_links

def remove_numbers(text):
    removed_numbers = text.replace(r'\d+','')#去除数字
    return removed_numbers

def remove_emails(text):
    no_emails = text.replace(r"\S*@\S*\s?",'')#去除邮件
    return no_emails
df['message'] = df['message'].apply(remove_website_links)
df['message'] = df['message'].apply(remove_numbers)
df['message'] = df['message'].apply(remove_emails)
df.head()
label message char words sen
0 0 Go until jurong point, crazy.. Available only ... 111 24 2
1 0 Ok lar... Joking wif u oni... 29 8 2
2 1 Free entry in 2 a wkly comp to win FA Cup fina... 155 37 2
3 0 U dun say so early hor... U c already then say... 49 13 1
4 0 Nah I don't think he goes to usf, he lives aro... 61 15 1

3.2 文本特征转换

def message_transform(text):
  
  text = text.lower()#转换为小写
  
  text = nltk.word_tokenize(text)#分词处理
  
  # 去除停用词和标点
  y = []#创建一个空列表
  for word in text:
    stopwords_punc = stopwords.words('english')+list(string.punctuation)#存放停用词和标点
    if word.isalnum()==True and word not in stopwords_punc:
      y.append(word)
  
  # 词根变换
  message=y[:]
  y.clear()
  for i in message:
    ps=PorterStemmer()
    y.append(ps.stem(i))
  return " ".join(y)#返回字符串形式
df['message'] = df['message'].apply(message_transform)
df['num_words_transform']=df['message'].apply(lambda x: len(str(x).split()))
df.head()
label message char words sen
0 0 Go until jurong point, crazy.. Available only ... 111 24 2
1 0 Ok lar... Joking wif u oni... 29 8 2
2 1 Free entry in 2 a wkly comp to win FA Cup fina... 155 37 2
3 0 U dun say so early hor... U c already then say... 49 13 1
4 0 Nah I don't think he goes to usf, he lives aro... 61 15 1

4.词频统计

4.1绘制词云

#绘制信息中出现最多的词的词云
from wordcloud import WordCloud
#首先,创建一个object
wc=WordCloud(width=500,height=500,min_font_size=10,background_color='white')
# 垃圾信息的词云
spam_wc=wc.generate(df[df['label']==1]['message'].str.cat(sep=""))
plt.figure(figsize=(18,12))
plt.imshow(spam_wc)
<matplotlib.image.AxesImage at 0x7fce5d938710>

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

可以看出,这些垃圾邮件出现频次最多的单词是:free、call等这种具有诱导性的信息

# 正常信息的词云
ham_wc = wc.generate(df[df['label']==0]['message'].str.cat(sep=''))
plt.figure(figsize=(18,12))
plt.imshow(ham_wc)
<matplotlib.image.AxesImage at 0x7fce607af190>

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

可以看出正常信息出现频次较多的单词为u、go、got、want等一些传达信息的单词

为了简化词云图的信息,我们现在分别统计垃圾短信和正常短信频次top30的单词

4.2找出词数top30的单词

垃圾短信:

# 统计词频
spam_corpus=[]
for i in df[df['label']==1]['message'].tolist():
  for word in i.split():
        spam_corpus.append(word)

from collections import Counter
Counter(spam_corpus)#记数
Counter(spam_corpus).most_common(30)#取最多的30个单词
plt.figure(figsize=(10,7))
sns.barplot(y=pd.DataFrame(Counter(spam_corpus).most_common(30))[0],x=pd.DataFrame(Counter(spam_corpus).most_common(30))[1])
plt.xticks()
plt.xlabel("Frequnecy")
plt.ylabel("Spam Words")
plt.show()

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

正常短信

ham_corpus=[]
for i in df[df['label']==0]['message'].tolist():
  for word in i.split():
    ham_corpus.append(word)
from collections import Counter
plt.figure(figsize=(10,7))
sns.barplot(y=pd.DataFrame(Counter(ham_corpus).most_common(30))[0],x=pd.DataFrame(Counter(ham_corpus).most_common(30))[1])
plt.xticks()
plt.xlabel("Frequnecy")
plt.ylabel("Ham Words")
plt.show()

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

下面进一步分析垃圾短信和非垃圾短信的单词和字符数分布情况

# 字符数
fig,(ax1,ax2)=plt.subplots(1,2,figsize=(15,6))
text_len=df[df['label']==1]['text'].str.len()
ax1.hist(text_len,color='green')
ax1.set_title('Original text')
text_len=df[df['label']==0]['text'].str.len()
ax2.hist(text_len,color='red')
ax2.set_title('Fake text')
fig.suptitle('Characters in texts')
plt.show()

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

#单词数
fig,(ax1,ax2)=plt.subplots(1,2,figsize=(15,6))
text_len=df[df['label']==1]['num_words_transform']
ax1.hist(text_len,color='red')
ax1.set_title('Original text')
text_len=df[df['label']==0]['num_words_transform']
ax2.hist(text_len,color='green')
ax2.set_title('Fake text')
fig.suptitle('Words in texts')
plt.show()

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

总结
经过上面分析,我们可以得出结论,垃圾短信文本与非垃圾短信文本相比具有更多的单词和字符。

  • 垃圾短信中包含的平均字符数约为 90 个字符
  • 垃圾短信中包含的平均字数约为 15 个字

5.模型构建

根据历史经验,在文本数据上朴素贝叶斯算法效果很好,因此我们将使用它,但在此过程中还将它与不同的算法进行比较。
在统计学中,朴素贝叶斯分类器是一系列简单的“概率分类器”,它们基于应用贝叶斯定理和特征之间的(朴素)条件独立假设。它们是最简单的贝叶斯网络模型之一,但与核密度估计相结合,它们可以达到更高的准确度水平。

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

首先,我们这里的输入数据是文本数据,不能够直接建立模型。因此,我们必须将这些文本数据进行特征提取。比较常用的几种方法:

  • 词袋模型(Bag of words) 存在稀疏性问题
  • TF-IDF
  • Word2vec

因为是实战训练,在这里不具体展开的几种方法的原理,在这里我选择TF-IDF

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

我也试了一下Word embedding,结合一些深度学习的方法,精度能够有所提高,感兴趣的小伙伴可以自己尝试一下,基本步骤类似。下面我们首先建立贝叶斯模型。

5.1 构建贝叶斯模型

from sklearn.feature_extraction.text import TfidfVectorizer
tfidf = TfidfVectorizer(max_features=3000)
X = tfidf.fit_transform(df['message']).toarray()
y = df['label'].values
array([0, 0, 1, ..., 0, 0, 0])
from sklearn.model_selection import train_test_split
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.2,random_state=2)#训练集测试集划分

from sklearn.naive_bayes import GaussianNB,MultinomialNB,BernoulliNB
from sklearn.metrics import accuracy_score,confusion_matrix,precision_score

这里我们比较三种不同的贝叶斯模型的各个评估指标结果

#GaussianNB
gnb = GaussianNB()
gnb.fit(X_train,y_train)
y_pred1 = gnb.predict(X_test)
print("Accuracy Score -",accuracy_score(y_test,y_pred1))
print("Precision Score -",precision_score(y_test,y_pred1))
print(confusion_matrix(y_test,y_pred1))
Accuracy Score - 0.8456014362657092
Precision Score - 0.47038327526132406
[[807 152]
 [ 20 135]]
#MultinomialNB
mnb = MultinomialNB()
mnb.fit(X_train,y_train)
y_pred2 = mnb.predict(X_test)
print("Accuracy Score -",accuracy_score(y_test,y_pred2))
print("Precision Score -",precision_score(y_test,y_pred2))
print(confusion_matrix(y_test,y_pred2))
Accuracy Score - 0.9793536804308797
Precision Score - 0.9925373134328358

[[958   1]
 [ 22 133]]
#Bernuli
bnb = BernoulliNB()
bnb.fit(X_train,y_train)
y_pred3 = bnb.predict(X_test)
print("Accuracy Score -",accuracy_score(y_test,y_pred3))
print("Precision Score -",precision_score(y_test,y_pred3))
print(confusion_matrix(y_test,y_pred3))
Accuracy Score - 0.9829443447037702
Precision Score - 1.0
[[959   0]
 [ 19 136]]

从上述结果来看,我选择了BNB来建模

5.2 模型比较

下面我们继续比较其他几种常见的分类模型的效果

#导入基本库
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.naive_bayes import MultinomialNB
from sklearn.tree import DecisionTreeClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import BaggingClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.ensemble import GradientBoostingClassifier
from xgboost import XGBClassifier
from sklearn.metrics import precision_score, recall_score, plot_confusion_matrix, classification_report, accuracy_score, f1_score
from sklearn.model_selection import cross_val_score
# 构建多个分类器
classifiers={"svc":SVC(kernel='sigmoid', gamma=1.0),
            "knc": KNeighborsClassifier(),
             "bnb" : BernoulliNB(),
             "dtc" : DecisionTreeClassifier(max_depth=5),
             "lr" : LogisticRegression(solver='liblinear', penalty='l1'),
             "rfc" : RandomForestClassifier(n_estimators=50, random_state=2),
             "adb" : AdaBoostClassifier(n_estimators=50, random_state=2),
             "xgb" : XGBClassifier(n_estimators=50,random_state=2),
             "gbc" : GradientBoostingClassifier(n_estimators=50,random_state=2)
            }
# 训练分类器函数
def train_classifier(clf,X_train,y_train,X_test,y_test):
    clf.fit(X_train,y_train)
    y_pred = clf.predict(X_test)
    
    accuracy = accuracy_score(y_test,y_pred)
    precision = precision_score(y_test,y_pred)
    train_accuracy = clf.score(X_train,y_train)
    
    return accuracy,precision,train_accuracy
# 得到各个模型的评估结果
accuracy_scores = []
precision_scores = []
train_accuracy_score=[]

for name,clf in classifiers.items():
    
    current_accuracy,current_precision,current_train_score = train_classifier(clf, X_train,y_train,X_test,y_test)
    
    print("For ",name)
    print("Accuracy - ",current_accuracy)
    print("Precision - ",current_precision)
    
    accuracy_scores.append(current_accuracy)
    precision_scores.append(current_precision)
    train_accuracy_score.append(current_train_score)
    print()
For  svc
Accuracy -  0.9802513464991023
Precision -  0.9784172661870504

For  knc
Accuracy -  0.9093357271095153
Precision -  1.0

For  bnb
Accuracy -  0.9829443447037702
Precision -  1.0

For  dtc
Accuracy -  0.9299820466786356
Precision -  0.8811881188118812

For  lr
Accuracy -  0.9622980251346499
Precision -  0.959349593495935

For  rfc
Accuracy -  0.9721723518850988
Precision -  0.9920634920634921

For  adb
Accuracy -  0.966786355475763
Precision -  0.9338235294117647

For  xgb
Accuracy -  0.9443447037701975
Precision -  0.9514563106796117

For  gbc
Accuracy -  0.9542190305206463
Precision -  0.9642857142857143


为了方便对比,将上述结果存放到dataframe中

df1=pd.DataFrame({'Algorithm':classifiers.keys(),'Precision':precision_scores,
                  'Test Accuracy':accuracy_scores}).round(3)
df2=df1.sort_values(['Precision','Test Accuracy'],ascending=False)#排序
df2
Algorithm Precision Test Accuracy
2 bnb 1.000 0.983
1 knc 1.000 0.909
5 rfc 0.992 0.972
0 svc 0.978 0.980
8 gbc 0.964 0.954
4 lr 0.959 0.962
7 xgb 0.951 0.944
6 adb 0.934 0.967
3 dtc 0.881 0.930

通过对比,选择BNB模型,模型的precision为100%,accuracy为98.3%

6.模型部署

import pickle
pickle.dump(tfidf,open('vectorizer.pkl','wb'))
pickle.dump(mnb,open('model.pkl','wb'))

然后打开 IDE 并创建自己的虚拟环境。使用 pip 或 conda 安装所需的所有包。我们将使用 streamlit 构建我们的网站。

设置完成后,创建app.py文件

import streamlit as st
import pickle
import string
from nltk.corpus import stopwords
import nltk
from nltk.stem.porter import PorterStemmer
ps = PorterStemmer()
def transform_text(text):
    text = text.lower()
    text = nltk.word_tokenize(text)
    y = []
    for i in text:
        if i.isalnum():
            y.append(i)
    text = y[:]
    y.clear()
    for i in text:
        if i not in stopwords.words('english') and i not in string.punctuation:
            y.append(i)
    text = y[:]
    y.clear()
    for i in text:
        y.append(ps.stem(i))
    return " ".join(y)
tfidf = pickle.load(open('vectorizer.pkl','rb'))
model = pickle.load(open('model.pkl','rb'))
st.title("垃圾短信/邮件分类器")
input_sms = st.text_area("输入你要检测的内容")
if st.button('Predict'):
    # 1. preprocess
    transformed_sms = transform_text(input_sms)
    # 2. vectorize
    vector_input = tfidf.transform([transformed_sms])
    # 3. predict
    result = model.predict(vector_input)[0]
    # 4. Display
    if result == 1:
        st.header("垃圾短信!")
    else:
        st.header("正常短信~")

然后在本地运行

streamlit run app.py

然后就能到达下面这个界面了,将短信或者邮件输入点击预测就可以了

nlp 内容检测,自然语言处理,人工智能,机器学习,数据科学

篇幅有限,完整代码可以在我的github上面查看,欢迎大家star,fork。

github地址:完整代码

如果访问不了github的可以私信我获取源码。文章来源地址https://www.toymoban.com/news/detail-786848.html

到了这里,关于【数据科学项目02】:NLP应用之垃圾短信/邮件检测(端到端的项目)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 机器学习——使用朴素贝叶斯分类器实现垃圾邮件检测(python代码+数据集)

    机器学习——scikit-learn库学习、应用 机器学习——最小二乘法拟合曲线、正则化 机器学习——使用朴素贝叶斯分类器实现垃圾邮件检测(python代码+数据集) 贝叶斯公式: P ( A ∣ B ) = P ( A ) P ( B ∣ A ) P ( B ) P(A mid B)=frac{P(A) P(B mid A)}{P(B)} P ( A ∣ B ) = P ( B ) P ( A ) P ( B ∣ A )

    2024年02月10日
    浏览(34)
  • SMS垃圾短信识别项目

    随着数字通信的快速发展,垃圾短信成为了一个普遍而烦人的问题。这些不请自来的消息不仅打扰了我们的日常生活,还可能包含诈骗和欺诈的风险。因此,有效地识别并过滤垃圾短信变得至关重要。 本项目的主要目标是开发一个机器学习模型,能够自动、准确地区分垃圾短

    2024年04月15日
    浏览(24)
  • 【Python数据科学 | 11】应用实战:我的第一个开源项目-基金定投回测工具

    这是机器未来的第60篇文章 原文首发地址:https://robotsfutures.blog.csdn.net/article/details/127712752 【Python数据科学快速入门系列 | 01】Numpy初窥——基础概念 【Python数据科学快速入门系列 | 02】创建ndarray对象的十多种方法 【Python数据科学快速入门系列 | 03】玩转数据摘取:Numpy的索引

    2024年02月02日
    浏览(26)
  • 关于自己搭建的邮件被微软反垃圾邮件标记为垃圾邮件

    昨天发的邮件被拒绝了,提示这么一堆英文:翻译过来的意思是:被微软的反垃圾邮件标记为垃圾邮件了,解决方法就是:登陆微软的反垃圾:https://sender.office.com/ 输入禁止的邮件和IP地址即可申诉!   This is the mail system at host mail.china-dacom.com. I\\\'m sorry to have to inform you that yo

    2024年02月16日
    浏览(32)
  • K210项目实战(口罩检测系统和垃圾分类系统)

    在前面我学习了使用K210训练模型做目标检测,然后也学会了使用K210做串口通信,学完之后我就把K210丢在箱子里吃灰了,因为学校疫情原因,两年一届的电赛很遗憾不能参加了,然后我就想拿他做个口罩检测系统(检测到没戴口罩可以语言提醒),这个真的好简单,哈哈哈,接

    2023年04月14日
    浏览(24)
  • 基于文本内容的垃圾短信识别实战

    背景: 垃圾短信形式日益多变,相关报告可以在下面网站查看 360互联网安全中心(http://zt.360.cn/report/) 目标: 基于短信文本内容,建立识别模型,准确地识别出垃圾短信,以解决垃圾短信过滤问题 1、数据探索 导入数据 更换列名 查看数据形状 整体查看数据 查看数据是否

    2024年02月16日
    浏览(37)
  • [数据集][目标检测]垃圾目标检测数据集VOC格式14963张44类别

    数据集格式:Pascal VOC格式(不包含分割的txt文件,仅仅包含jpg图片和对应的xml) 图片数量(jpg文件个数):14963 标注数量(xml文件个数):14963 标注类别数:44 标注类别名称:[\\\"toiletries\\\",\\\"plastic utensils\\\",\\\"seasoning bottles\\\",\\\"leftovers\\\",\\\"chopsticks\\\",\\\"ceramic utensils\\\",\\\"pots\\\",\\\"metal utensils\\\",\\\"cutting boards\\\",\\\"ol

    2024年02月11日
    浏览(31)
  • 垃圾邮件识别(一):用机器学习做中文邮件内容分类

    随着微信的迅速发展,工作和生活中的交流也更多依赖于此,但是由于邮件的正式性和规范性,其仍然不可被取代。但是不管是企业内部工作邮箱,还是个人邮箱,总是收到各种各样的垃圾邮件,包括商家的广告、打折促销信息、澳门博彩邮件、理财推广信息等等,不管如何

    2024年02月08日
    浏览(42)
  • 朴素贝叶斯(垃圾邮件分类)

      朴素贝叶斯是经典的机器学习算法之一,也是为数不多的基于概率论的分类算法。对于大多数的分类算法,在所有的机器学习分类算法中,朴素贝叶斯和其他绝大多数的分类算法都不同。比如决策树,KNN,逻辑回归,支持向量机等,他们都是判别方法,也就是直接学习出特

    2024年02月07日
    浏览(39)
  • 目标检测算法——垃圾分类数据集汇总(附下载链接)

    一、Kaggle 垃圾分类图片数据集 二、垃圾分类数据集 三、塑料-纸张-垃圾袋合成图像数据集 四、垃圾溢出数据集 关于YOLO算法改进及论文投稿可关注并留言博主的CSDN/QQ 一起交流!互相学习!共同进步! 数据集下载链接:https://www.cvmart.net/dataSets 该数据集是图片数据,分为训练

    2023年04月24日
    浏览(29)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包