【Python自然语言处理】使用逻辑回归(logistic)对电影评论情感分析实战(超详细 附源码)

news2024/11/19 15:12:48

需要源码和数据集请点赞关注收藏后评论区留言私信~~~

一、舆情分析

舆情分析很多情况下涉及到用户的情感分析,或者亦称为观点挖掘,是指用自然语言处理技术、文本挖掘以及计算机语言学等方法来正确识别和提取文本素材中的主观信息,通过对带有情感因素主观性文本进行分析,以确定该文本的情感倾向。

文本情感分析的途径: 关键词识别 词汇关联 统计方法 概念级技术

目前主流的情感分析方法主要有两种:基于情感词典的分析法和基于机器学习的分析法

1、 基于情感词典的情感分析

是指根据已构建的专家情感词典,针对对象分析文本进行文本处理抽取关键情感词,计算对象文本的情感倾向。最终分类质量很大程度上取决于专家情感词典的完善度和准确度。目前比较具有代表性的中文情感词典,包括知网情感分析用词语集,台湾大学情感词典,清华大学褒贬词词典等。

2、基于机器学习的情感分析

情感分析本质上也是个二分类的问题,可以采用机器学习的方法识别,选取文本中的情感词作为特征词,将文本矩阵化,利用逻辑回归( logistic Regression )、 朴素贝叶斯(Naive Bayes)、支持向量机(SVM)、K-means以及K-means++等方法进行分类。最终分类效果取决于训练文本的选择以及正确的情感标注。

K-means算法的基本步骤为:

(1)指定聚类数量K(可以通过最优算法获得)。

(2)从数据集中任意随机选取k个对象作为初始聚类中心点或者平均值。

(3)将每个数据点指派给距离其最近的中心点,计算欧几里得距离。

(4)基于k种聚类,计算聚类数据点的新平均值,更新其聚类中心点, 第K个聚类的中心点是一个矢量,该矢量包含此聚类种所有观察点变量的平均值的长度。

(5)迭代计算并最小化总的聚类平方和。重复执行步骤3和步骤4,直到聚类分类结果不再变化或者达到最大迭代次数。

对于K-Means算法可以参见我以下这两篇博客

k-means银行客户画像分组

k-means物流分配实战

二、电影评论情感分析实战

下面我们以基于用户的电影评论为基础,使用IMDB电影评论数据,进行主观情感分析,原始数据总共包括正面和负面评价各25000条。

先导入库文件 主要包括Sklearn里面的一些模块 代码如下

#导入库
from sklearn.metrics import classification_report,confusion_matrix,accuracy_score
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.preprocessing import LabelBinarizer
import numpy as np
import pandas as pds
import seaborn as sns
import matplotlib.pyplot as plt
import nltk
from nltk.tokenize.toktok import ToktokTokenizer
from nltk.stem import LancasterStemmer,WordNetLemmatizer
from sklearn.linear_model import LogisticRegression,SGDClassifier
from sklearn.naive_bayes import MultinomialNB
from sklearn.svm import SVC
from textblob import TextBlob
from textblob import Word
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize,sent_tokenize
from bs4 import BeautifulSoup
import spacy
import re,string,unicodedata
import seaborn as sns

读入数据 打印正面、负面情感的数值统计结果 各自包含25000条记录

 

划分训练集和测试机数据,关注评论详细信息以及正面评价或者负面评价的标识信息,分别选定数据的最初45000条记录作为训练集,而剩余的5000条作为测试集,因此测试数据的比例为百分之十,此处可以适当调整,评估的结果也会发生相应变化

接下来用词袋模型和词频-逆文档模型将文本向量化,然后使用逻辑回归模型执行回归处理此处不再赘述 下面直接展示结果

 评论的统计结果如下 可以大部分评论在100词左右 也符合实际情况

 

 接下来看看两种模型的准确性评估

可见相差不大 两种模型的准确性评估结果为0.75-0.77  维持在大致相当的水平,用户的正面评价和负面评价的指标分析结果没有发生很大差异

 

 

 三、代码

代码如下 数据集请点赞关注收藏后评论区留言私信~~~

代码主要是jupyter notebook格式 需要python文件格式点赞关注收藏后评论区留言私信即可~

classification_report,confusion_matrix,accuracy_score\n",
    "from sklearn.feature_extraction.text import CountVectorizer\n",
    "from sklearn.feature_extraction.text import TfidfVectorizer\n",
    "from sklearn.preprocessing import LabelBinarizer\n",
    "import numpy as np\n",
    "import pandas as pds\n",
    "import seaborn as sns\n",
    "import matplotlib.pyplot as plt\n",
    "import nltk\n",
    "from nltk.tokenize.toktok import ToktokTokenizer\n",
    "from nltk.stem import LancasterStemmer,WordNetLemmatizer\n",
    "from sklearn.linear_model import LogisticRegression,SGDClassifier\n",
    "from sklearn.naive_bayes import MultinomialNB\n",
    "from sklearn.svm import SVC\n",
    "from textblob import TextBlob\n",
    "from textblob import Word\n",
    "from nltk.corpus import stopwords\n",
    "from nltk.stem.porter import PorterStemmer\n",
    "from nltk.stem import WordNetLemmatizer\n",
    "from nltk.tokenize import word_tokenize,sent_tokenize\n",
    "from bs4 import BeautifulSoup\n",
    "import spacy\n",
    "import re,string,unicodedata\n",
    "import seaborn as sns\n",
    "\n",
    "\n",
    "\n"
25000\n",
       "Name: sentiment, dtype: int64"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#读入数据\n",
    "data=pds.read_csv('data/IMDB Dataset.csv')\n",
    "data.head(5)\n",
    "#统计情感信息\n",
    "data['sentiment'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "_uuid": "d3aaabff555e07feb11c72cc3a6e457615975ffe"
   },
   "outputs": [],
   "source": [
    "# 划分训练集和测试集数据\n",
    "train_evaluate=data.review[:45000]\n",
    "test_evaluate=data.review[45000:]\n",
    "\n",
    "train_flag=data.sentiment[:45000]\n",
    "test_flag=data.sentiment[45000:]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "_uuid": "f000c43d91f68f6668539f089c6a54c5ce3bd819"
   },
   "outputs": [],
   "source": [
    "#文本分词\n",
    "#tokenizer=ToktokTokenizer()\n",
    "#设置停用词\n",
    "#stopword=nltk.corpus.stopwords.words('english')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "_uuid": "219da72b025121fd98081df50ae0fcaace10cc9d"
   },
   "outputs": [],
   "source": [
    "#去除特殊字符\n",
    "def regex_character_remove(info, remove_digits=True):\n",
    "    regx=r'[^A-za-z0-9#@$\\s]'\n",
    "    outcome=re.sub(regx,'',info)\n",
    "    return outcome\n",
    "#针对评论数据删除特殊字符\n",
    "data['review']=data['review'].apply(regex_character_remove)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "_uuid": "2295f2946e0ab74c220ad538d0e7adc04d23f697"
   },
   "outputs": [],
   "source": [
    "#分词\n",
    "def stem(info):\n",
    "    ps=nltk.porter.PorterStemmer()\n",
    "    outcome= ' '.join([ps.stem(k) for k in info.split()])\n",
    "    return outcome\n",
    "data['review']=data['review'].apply(stem)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "_uuid": "5dbff82b4d2d188d8777b273a75d8ac714d38885"
   },
   "outputs": [],
   "source": [
    "#删除停用词\n",
    "stopwords=set(stopwords.words('english'))\n",
    "tokenizer=ToktokTokenizer()\n",
    "\n",
    "def remove_stopwords(info, is_lower_case=False):\n",
    "    tks = tokenizer.tokenize(info)\n",
    "    tks = [tk.strip() for tk in tks]\n",
    "    if is_lower_case:\n",
    "        ftk = [tk for tk in tks if tk not in stopwords]\n",
    "    else:\n",
    "        ftk = [tk for tk in tks if tk.lower() not in stopwords]\n",
    "    filter_info = ' '.join(ftk)    \n",
    "    return filter_info\n",
    "\n",
    "data['review']=data['review'].apply(remove_stopwords)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "_kg_hide-output": true,
    "_uuid": "b20c242bd091929ca896ea2c6e936ca00efe6ecf"
   },
   "outputs": [],
   "source": [
    "\n",
    "n_train_reviews=data.review[:45000]\n",
    "n_test_reviews=data.review[45000:]\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "1c2a872ffcb6b8076fdbbba641af12081b6022ef"
   },
   "source": [
    "**Bags of words model **\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "_uuid": "35cf9dcefb40b2dc520c5b0d559695324c46cc04"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "词袋模型训练数据: (45000, 6813632)\n",
      "词袋模型测试数据: (5000, 6813632)\n"
     ]
    }
   ],
   "source": [
    "#词袋模型向量化\n",
    "cvr=CountVectorizer(min_df=0,max_df=1,binary=False,ngram_range=(1,3))\n",
    "cvr_train_reviews=cvr.fit_transform(n_train_reviews)\n",
    "cvr_test_reviews=cvr.transform(n_test_reviews)\n",
    "\n",
    "print('词袋模型训练数据:',cvr_train_reviews.shape)\n",
    "print('词袋模型测试数据:',cvr_test_reviews.shape)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "52371868f05ff9cf157280c5acf0f5bc71ee176d"
   },
   "source": [
    "**Term Frequency-Inverse Document Frequency model (TFIDF)**\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "_uuid": "afe6de957339921e05a6faeaf731f2272fd31946",
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "#TF-IDF向量化\n",
    "td=TfidfVectorizer(min_df=0,max_df=1,use_idf=True,ngram_range=(1,3))\n",
    "td_train_reviews=td.fit_transform(n_train_reviews)\n",
    "td_test_reviews=td.transform(n_test_reviews)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "_uuid": "60f5d496ce4109d1cdbf08f4284d4d26efd93922"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(50000, 1)\n"
     ]
    }
   ],
   "source": [
    "#标注情感数据\n",
    "lb=LabelBinarizer()\n",
    "sm_data=lb.fit_transform(data['sentiment'])\n",
    "print(sm_data.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "_kg_hide-output": true,
    "_uuid": "ca1e4cc917265ac98a72c37cffe57f27e9897408"
   },
   "outputs": [],
   "source": [
    "#分割电影评论数据\n",
    "train_sm=sm_data[:45000]\n",
    "test_sm=sm_data[45000:]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "_uuid": "142d007421900550079a12ae8655bcae678ebaad"
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\users\\ichiro\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\sklearn\\utils\\validation.py:578: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n",
      "  y = column_or_1d(y, warn=True)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "LogisticRegression(C=1, class_weight=None, dual=False, fit_intercept=True,\n",
      "          intercept_scaling=1, max_iter=500, multi_class='ovr', n_jobs=1,\n",
      "          penalty='l2', random_state=42, solver='liblinear', tol=0.0001,\n",
      "          verbose=0, warm_start=False)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\users\\ichiro\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\sklearn\\utils\\validation.py:578: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n",
      "  y = column_or_1d(y, warn=True)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "LogisticRegression(C=1, class_weight=None, dual=False, fit_intercept=True,\n",
      "          intercept_scaling=1, max_iter=500, multi_class='ovr', n_jobs=1,\n",
      "          penalty='l2', random_state=42, solver='liblinear', tol=0.0001,\n",
      "          verbose=0, warm_start=False)\n"
     ]
    }
   ],
   "source": [
    "#使用逻辑回归模型\n",
    "lr=LogisticRegression(penalty='l2',max_iter=500,C=1,random_state=42)\n",
    "#基于词袋模型拟合\n",
    "lr_fit=lr.fit(cvr_train_reviews,train_sm)\n",
    "print(lr_fit)\n",
    "#基于TF-IDF模型拟合\n",
    "lr_tfidf=lr.fit(td_train_reviews,train_sm)\n",
    "print(lr_tfidf)\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<seaborn.axisgrid.FacetGrid at 0x1fdb01eda20>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAFgCAYAAACFYaNMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAczUlEQVR4nO3df5RfdX3n8eebmcyAiZWgMUuBc4ia7S7dsyIbEbW2VleItKfoOUrDcSWwaGqFVotrD+hu7Y/1nNpWKa6CRklFjwXRak0tiiki6qpIUOSnyPhrSQ4kUfyRGZqkmbz3j+/nG74MM5kf+d7vZ74zz8c53zP3fu693+97bmZeufO5935uZCaSpN47onYBkrRYGcCSVIkBLEmVGMCSVIkBLEmVDNYuoAlr167Nz33uc7XLkKS2mKxxQR4B//jHP65dgiRNa0EGsCT1AwNYkioxgCWpEgNYkioxgCWpEgNYkioxgCWpEgNYkioxgCWpEgNYkioxgCWpEgNYkioxgOcoMxkdHcVn6kmaKwN4jsbGxlh3+WcZGxurXYqkPmUAH4aBoaNqlyCpjxnAklRJYwEcEUdGxDci4tsRcXdE/FlpXxURt0TESER8LCKGSvtwmR8py0/seK9LS/t9EXFGUzVLUi81eQS8F3hRZj4TOBlYGxGnAe8ALsvMZwA/BS4o618A/LS0X1bWIyJOAtYBvwqsBa6IiIEG65aknmgsgLNltMwuKa8EXgR8orRfDbysTJ9V5inLXxwRUdqvzcy9mfkDYAQ4tam6JalXGu0DjoiBiLgd2AlsAb4H/Cwz95dVtgHHlenjgAcAyvKfA0/ubJ9km87P2hARWyNi665duxr4biSpuxoN4Mwcz8yTgeNpHbX+hwY/a2NmrsnMNStWrGjqYySpa3pyFURm/gy4CXgucHREDJZFxwPby/R24ASAsvxJwE862yfZRpL6VpNXQayIiKPL9FHAS4B7aQXxK8pq64FPl+nNZZ6y/AvZus1sM7CuXCWxClgNfKOpuiWpVwanX2XOjgWuLlcsHAFcl5mfiYh7gGsj4n8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MezevXy3bjtAZMAnhOx3r7gI91vP//BT4UEa+lNeC4NCMGsBa8bI1k9gNaT7P4Kq0j4t8EnkFrvICp7MnM8Rm8/+uA/0lrVK3bIqKJMYC1ABnAWiy+DPwP4Etl+nXAt2gNmvMbEfGUcqLtHODmSba/paz35NJ98cr2goh4embekpl/Qmsw+RMm2V56nMHpV5EWhC/TGp3ra5k5FhF7gC9n5oPlwZA30Rox658z89MTNy7r/Smt7ouf0Rr5q+2vI2J12f5GWs85k6blaGiSVIldEJJUiQEsSZUYwJJUiQEsSZUYwJJUiQEsSZUYwJJUyf8Hl/42sRZtj6IAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "data['words'] = data['review'].apply(lambda y: len(y.split()))\n",
    "sns.displot(data=data, x=\"words\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "_uuid": "52ad86935b76117f97b79e6672a3ba12352b9461"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1 1 0 ... 0 1 1]\n",
      "[1 1 0 ... 0 1 1]\n"
     ]
    }
   ],
   "source": [
    "#词袋模型预测\n",
    "bow_pred=lr.predict(cvr_test_reviews)\n",
    "print(bow_pred)\n",
    "##TF-IDF模型预测\n",
    "tfidf_pred=lr.predict(td_test_reviews)\n",
    "print(tfidf_pred)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "词袋模型准确性: 0.7612\n",
      "TF-IDF模型准确性: 0.7608\n"
     ]
    }
   ],
   "source": [
    "#模型准确性评估\n",
    "bow_score=accuracy_score(test_sm,bow_pred)\n",
    "tfidf_score=accuracy_score(test_sm,tfidf_pred)\n",
    "print(\"词袋模型准确性:\",bow_score)\n",
    "print(\"TF-IDF模型准确性:\",tfidf_score)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "词袋模型:\n",
      "              precision    recall  f1-score   support\n",
      "\n",
      "   Positive      0.766     0.761     0.763      2530\n",
      "   Negative      0.757     0.762     0.759      2470\n",
      "\n",
      "avg / total      0.761     0.761     0.761      5000\n",
      "\n",
      "TD-IDF模型:\n",
      "              precision    recall  f1-score   support\n",
      "\n",
      "   Positive      0.764     0.763     0.764      2530\n",
      "   Negative      0.758     0.758     0.758      2470\n",
      "\n",
      "avg / total      0.761     0.761     0.761      5000\n",
      "\n"
     ]
    }
   ],
   "source": [
    "#分类报告 \n",
    "bow_report=classification_report(test_sm,bow_pred,digits=3,  labels=None,sample_weight=None,target_names=['Positive','Negative'])\n",
    "tfidf_report=classification_report(test_sm,tfidf_pred,digits=3, labels=None, sample_weight=None,target_names=['Positive','Negative'])\n",
    "print('词袋模型:\\n',bow_report)\n",
    "print('TD-IDF模型:\\n',tfidf_report)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'0.19.2'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import sklearn\n",
    "sklearn.__version__"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "ac2ec8353acb5e0f548e1e4a590fbe6f34f4a686"
   },
   "source": [
    "**Print the classification report**"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}

创作不易 觉得有帮助请点赞关注收藏~~~

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/62741.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

使用Visual Studio Code 进行Python编程(一)

1、下载Visual Studio Code 到微软的Visual Studio Code官方主页下载Visual Studio Code: Visual Studio: 面向软件开发人员和 Teams 的 IDE 和代码编辑器Visual Studio 开发工具和服务让任何开发人员在任何平台和语言的应用开发都更加轻松。 随时随地免费使用代码编辑器或 I…

Spire.Office for .NET 7.12.0 2022年最后版本?

谷歌能找到破解版是破坏强签名&#xff0c;不能用web&#xff0c;请把大家不要用Spire.Office for .NET is a combination of Enterprise-Level Office .NET API offered by E-iceblue. It includes Spire.Doc, Spire.XLS, Spire.Spreadsheet, Spire.Presentation, Spire.PDF, …

数据库开发项目 flask + html 01

目的 开放平台&#xff08;网站&#xff09; 前端开发 HTML CSS JavaScript Web框架&#xff1a; 接受请求并处理 MySQL数据库&#xff1a; 存储数据 快速上手&#xff1a; 基于 Flask Web框架 快速搭建网站。 进阶&#xff1a; 基于 Django框架 1. 快速开发网站 安装框架 …

(附源码)SSM介绍信智能实现系统 毕业设计 260930

SSM介绍信智能实现系统 摘 要 科技进步的飞速发展引起人们日常生活的巨大变化&#xff0c;电子信息技术的飞速发展使得电子信息技术的各个领域的应用水平得到普及和应用。信息时代的到来已成为不可阻挡的时尚潮流&#xff0c;人类发展的历史正进入一个新时代。在现实运用中&…

java+mysql基于SSM的大学生兼职信息系统-计算机毕业设计

开发环境 运行环境&#xff1a; 开发工具:IDEA /Eclipse 数据库:MYSQL5.7 应用服务:Tomcat7/Tomcat8 使用框架:SSM(springspringMVCmybatis)vue 项目介绍 论文主要是对大学生兼职信息系统进行了介绍&#xff0c;包括研究的现状&#xff0c;还有涉及的开发背景&#xff0c;然…

分享几款免费实用的国产内网穿透工具

对于没有公网IP的用户来说&#xff0c;如何实现远程管理或让局域网的服务可以被公网访问到是一个问题。当然&#xff0c;也有很多类似的需求&#xff0c;比如&#xff1a; 微信公众号小程序开发调试公网访问本地web项目异地远程处理公司服务问题异地访问公司内网财务/管理系统…

Qt 中模型视图编程的基本概念

背景 一个应用程序本质可以抽象为三部分&#xff1a;界面、逻辑处理、数据。程序中存储有大量的数据&#xff0c;经过逻辑处理后、通过界面展示给用户&#xff0c;同时用户可以通过界面对数据进行编辑&#xff0c;如下图所示&#xff1a; Qt 中的模型视图架构就是用来实现大量…

Spring_第3章_AOP+事务

Spring_第3章_AOP事务 文章目录Spring_第3章_AOP事务一、AOP1 AOP简介问题导入1.1 AOP简介和作用【理解】1.2 AOP中的核心概念【理解】2 AOP入门案例【重点】问题导入2.1 AOP入门案例思路分析2.2 AOP入门案例实现【第一步】导入aop相关坐标【第二步】定义dao接口与实现类【第三…

8 常规聚类

常规聚类 聚类分析是解决数据全方位自动分组的有效方式。若将数据全体视为一个大类&#xff0c;这个大类很可能是由若干个包含了一定数量观测的自然小类”组成的。聚类分析的目的就是找到这些隐藏于数据中的客观存在的“自然小类”&#xff0c;并通过刻画“自然小类”体现数据…

舆情监控软件

随着中国互联网的快速发展&#xff0c;舆情监测成为工作中的一部分&#xff0c;如果没有舆情监控软件的及时介入&#xff0c;负面舆情将会迅速扩大并蔓延到各个方面&#xff0c;对社会以及公众造成严重的影响&#xff0c;舆情监控软件对企业政府有着深远影响&#xff0c;接下来…

Python学习小组课程P5-Python办公(2)Excel读取与Word生成

一、前言 注意&#xff1a;此为内部小组学习资料&#xff0c;非售卖品&#xff0c;仅供学习参考。 本系列课程&#xff1a; Python学习小组课程-课程大纲与Python开发环境安装 Python学习小组课程P1-Python基础&#xff08;1&#xff09;语法与数组 Python学习小组课程P2-Pyth…

【配电网重构】基于yalmip求解含sop+二阶锥配电网重构附matlab代码

✅作者简介&#xff1a;热爱科研的Matlab仿真开发者&#xff0c;修心和技术同步精进&#xff0c;matlab项目合作可私信。 &#x1f34e;个人主页&#xff1a;Matlab科研工作室 &#x1f34a;个人信条&#xff1a;格物致知。 更多Matlab仿真内容点击&#x1f447; 智能优化算法 …

ouster-32激光雷达使用---雷达输出数据分析

ouster-32激光雷达使用---雷达输出数据分析雷达输出数据分析所有数据imu数据雷达数据坐标系Rviz显示雷达输出数据分析 所有数据 查看当前topic消息种类 rostopic list终端输出 /clicked_point /initialpose /move_base_simple/goal /os_node/imu_packets /os_node/lidar_pa…

ADSP-21489的开发详解:VDSP+自己编程写代码开发(2-软件和硬件的开发环境搭建)

Visual DSP软件的安装 运行 setup 软件安装包&#xff0c;全部下一步即可完成软件安装&#xff0c;非常简单。我们的资料里提供了 VDSP5.1.2 软件&#xff0c;当然您也可以通过 ADI 公司官网下载。 VDSP5.1.2 软件官网下载地址&#xff1a; Visual DSP5.1.2的ADI官网下载链接…

2022深入学习C++教程

2022深入学习C教程 课堂和实践课程 – C 11 的功能、异常处理和 STL – 适用于学术界和工业界 课程英文名&#xff1a;Learn C Programming -Beginner to Advance- Deep Dive in C 此视频教程共30.0小时&#xff0c;中英双语字幕&#xff0c;画质清晰无水印&#xff0c;源码…

Composer交互文档如何在PPT当中使用

在往期的公开课中我们讲解了SOLIDWORKS Composer这样一款三维制作软件&#xff0c;Composer可以很好的利用SOLIDWORKS所设计的数据自动生成产品手册、装配目录、维修说明&#xff0c;以及销售和培训视频等&#xff0c;还可以为用户提供非常满意的交互式体验。 并且Composer和S…

抖音怎么录屏?这个方法,亲测好用

​抖音是现在流行的短视频软件之一&#xff0c;很多小伙伴喜欢用它来记录生活&#xff0c;分享生活中新鲜有趣的事情。有时候&#xff0c;在抖音上看到了喜欢的视频&#xff0c;想要分享给好友&#xff0c;发现抖音无法分享&#xff0c;这个时候就需要使用到屏幕录制功能了。那…

【电力系统】含电热联合系统的微电网运行优化附matlab代码和复现论文

✅作者简介&#xff1a;热爱科研的Matlab仿真开发者&#xff0c;修心和技术同步精进&#xff0c;matlab项目合作可私信。 &#x1f34e;个人主页&#xff1a;Matlab科研工作室 &#x1f34a;个人信条&#xff1a;格物致知。 更多Matlab仿真内容点击&#x1f447; 智能优化算法 …

我国跨国企业外汇风险管理——以海尔公司为例

目 录 摘 要 I 一、 绪论 1 &#xff08;一&#xff09; 选题背景及意义 1 &#xff08;二&#xff09; 国内研究现状 1 1&#xff0e; 国外研究现状 1 2&#xff0e; 国内研究现状 3 &#xff08;三&#xff09; 研究内容及方法 3 &#xff08;四&#xff09; 跨国企业外汇风险…

C语言 字符串

C语言 字符串引言一、字符串的创建方式二、字符串函数1. strlen 函数使用示例1使用示例2模拟 strlen 函数2. strcpy 函数使用示例模拟 strcpy 函数3. strcat 函数使用示例模拟 strcat 函数4. strcmp 函数使用示例模拟 strcmp 函数5. strncpy、strncat、strncmp6. strstr 函数使…