直接看结果: 代码:
import re
from collections import defaultdict
import random
import matplotlib.pyplot as plt
import numpy as npimport pandas as pd
import numpy as np
import re
from sklearn.feature_extraction.text import CountVectorizer
from nltk.corpus…
import torch
import torch.nn as nn
from transformers import BertModel, BertTokenizer# 通过torch.hub(pytorch中专注于迁移学的工具)获得已经训练好的bert-base-chinese模型
# model torch.hub.load(huggingface/pytorch-transformers, model, bert-base-chinese)
model…