本文案例为假新闻检测,主要使用模型为LSTM。通过案例的过程,来轻松的入门实践文本分类。
导入相关库
import re
import nltk
import numpy as np
import pandas as pd
import tensorflow as tf
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
from tensorflow.keras.models import Sequential
from sklearn.model_selection import train_test_split
from tensorflow.keras.preprocessing