当前位置: 首页 > news >正文

基于 Stanford CoreNLP 的中文自然语言处理

一、概述

Stanford CoreNLP 是斯坦福大学开发的一款强大的自然语言处理(NLP)工具,支持多种语言的文本处理,包括中文。本文将详细介绍如何使用 Stanford CoreNLP 实现中文文本的分词、词性标注、命名实体识别、句法分析等功能,并提供完整的代码示例和配置文件。

二、环境配置

1. Maven 依赖配置

在项目的 pom.xml 文件中添加以下依赖:

<dependencies><!-- Stanford CoreNLP --><dependency><groupId>edu.stanford.nlp</groupId><artifactId>stanford-corenlp</artifactId><version>${corenlp.version}</version></dependency><!-- Stanford CoreNLP Models --><dependency><groupId>edu.stanford.nlp</groupId><artifactId>stanford-corenlp</artifactId><version>${corenlp.version}</version><classifier>models</classifier></dependency><!-- Chinese Models --><dependency><groupId>edu.stanford.nlp</groupId><artifactId>stanford-corenlp</artifactId><version>${corenlp.version}</version><classifier>models-chinese</classifier></dependency>
</dependencies>

2. 配置文件

将以下配置文件保存为 CoreNLP-chinese.properties,并放置在 src/main/resources 目录下:

# Pipeline options - lemma is no-op for Chinese but currently needed because coref demands it (bad old requirements system)
annotators = tokenize, ssplit, pos, lemma, ner, parse, coref# segment
tokenize.language = zh
segment.model = edu/stanford/nlp/models/segmenter/chinese/ctb.gz
segment.sighanCorporaDict = edu/stanford/nlp/models/segmenter/chinese
segment.serDictionary = edu/stanford/nlp/models/segmenter/chinese/dict-chris6.ser.gz
segment.sighanPostProcessing = true# sentence split
ssplit.boundaryTokenRegex = [.\u3002]|[!?\uFF01\uFF1F]+# pos
pos.model = edu/stanford/nlp/models/pos-tagger/chinese-distsim.tagger# ner
ner.language = chinese
ner.model = edu/stanford/nlp/models/ner/chinese.misc.distsim.crf.ser.gz
ner.applyNumericClassifiers = true
ner.useSUTime = false# regexner
ner.fine.regexner.mapping = edu/stanford/nlp/models/kbp/chinese/gazetteers/cn_regexner_mapping.tab
ner.fine.regexner.noDefaultOverwriteLabels = CITY,COUNTRY,STATE_OR_PROVINCE# parse
parse.model = edu/stanford/nlp/models/srparser/chineseSR.ser.gz# depparse
depparse.model    = edu/stanford/nlp/models/parser/nndep/UD_Chinese.gz
depparse.language = chinese# coref
coref.sieves = ChineseHeadMatch, ExactStringMatch, PreciseConstructs, StrictHeadMatch1, StrictHeadMatch2, StrictHeadMatch3, StrictHeadMatch4, PronounMatch
coref.input.type = raw
coref.postprocessing = true
coref.calculateFeatureImportance = false
coref.useConstituencyTree = true
coref.useSemantics = false
coref.algorithm = hybrid
coref.path.word2vec =
coref.language = zh
coref.defaultPronounAgreement = true
coref.zh.dict = edu/stanford/nlp/models/dcoref/zh-attributes.txt.gz
coref.print.md.log = false
coref.md.type = RULE
coref.md.liberalChineseMD = false# kbp
kbp.semgrex = edu/stanford/nlp/models/kbp/chinese/semgrex
kbp.tokensregex = edu/stanford/nlp/models/kbp/chinese/tokensregex
kbp.language = zh
kbp.model = none# entitylink
entitylink.wikidict = edu/stanford/nlp/models/kbp/chinese/wikidict_chinese.tsv.gz

三、代码实现

1. 初始化 Stanford CoreNLP 管道

创建 CoreNLPHel 类,用于初始化 Stanford CoreNLP 管道:

import edu.stanford.nlp.pipeline.StanfordCoreNLP;public class CoreNLPHel {private static CoreNLPHel instance = new CoreNLPHel();private StanfordCoreNLP pipeline;private CoreNLPHel() {String props = "CoreNLP-chinese.properties"; // 配置文件路径pipeline = new StanfordCoreNLP(props);}public static CoreNLPHel getInstance() {return instance;}public StanfordCoreNLP getPipeline() {return pipeline;}
}

2. 分词功能

创建 Segmentation 类,用于实现中文分词:

import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import edu.stanford.nlp.util.CoreMap;import java.util.List;public class Segmentation {private String segtext;public String getSegtext() {return segtext;}public Segmentation(String text) {CoreNLPHel coreNLPHel = CoreNLPHel.getInstance();StanfordCoreNLP pipeline = coreNLPHel.getPipeline();Annotation annotation = new Annotation(text);pipeline.annotate(annotation);List<CoreMap> sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);StringBuffer sb = new StringBuffer();for (CoreMap sentence : sentences) {for (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {String word = token.get(CoreAnnotations.TextAnnotation.class);sb.append(word).append(" ");}}segtext = sb.toString().trim();}
}

3. 句子分割

创建 SenSplit 类,用于实现句子分割:

import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import edu.stanford.nlp.util.CoreMap;import java.util.ArrayList;
import java.util.List;public class SenSplit {private ArrayList<String> sensRes = new ArrayList<>();public ArrayList<String> getSensRes() {return sensRes;}public SenSplit(String text) {CoreNLPHel coreNLPHel = CoreNLPHel.getInstance();StanfordCoreNLP pipeline = coreNLPHel.getPipeline();Annotation annotation = new Annotation(text);pipeline.annotate(annotation);List<CoreMap> sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);for (CoreMap sentence : sentences) {sensRes.add(sentence.get(CoreAnnotations.TextAnnotation.class));}}
}

4. 词性标注

创建 PosTag 类,用于实现词性标注:

import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import edu.stanford.nlp.util.CoreMap;import java.util.List;public class PosTag {private String postext;public String getPostext() {return postext;}public PosTag(String text) {CoreNLPHel coreNLPHel = CoreNLPHel.getInstance();StanfordCoreNLP pipeline = coreNLPHel.getPipeline();Annotation annotation = new Annotation(text);pipeline.annotate(annotation);List<CoreMap> sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);StringBuffer sb = new StringBuffer();for (CoreMap sentence : sentences) {for (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {String word = token.get(CoreAnnotations.TextAnnotation.class);String pos = token.get(CoreAnnotations.PartOfSpeechAnnotation.class);sb.append(word).append("/").append(pos).append(" ");}}postext = sb.toString().trim();}
}

5. 命名实体识别

创建 NamedEntity 类,用于实现命名实体识别:

import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import edu.stanford.nlp.util.CoreMap;import java.util.List;public class NamedEntity {private String nertext;public String getNertext() {return nertext;}public NamedEntity(String text) {CoreNLPHel coreNLPHel = CoreNLPHel.getInstance();StanfordCoreNLP pipeline = coreNLPHel.getPipeline();Annotation annotation = new Annotation(text);pipeline.annotate(annotation);List<CoreMap> sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);StringBuffer sb = new StringBuffer();for (CoreMap sentence : sentences) {for (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {String word = token.get(CoreAnnotations.TextAnnotation.class);String ner = token.get(CoreAnnotations.NamedEntityTagAnnotation.class);sb.append(word).append("/").append(ner).append(" ");}}nertext = sb.toString().trim();}
}

6. 句法分析

创建 SPTree 类,用于实现句法分析:

import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import edu.stanford.nlp.semgraph.SemanticGraph;
import edu.stanford.nlp.semgraph.SemanticGraphCoreAnnotations;
import edu.stanford.nlp.trees.Tree;
import edu.stanford.nlp.trees.TreeCoreAnnotations;
import edu.stanford.nlp.util.CoreMap;import java.util.List;public class SPTree {private List<CoreMap> sentences;public SPTree(String text) {CoreNLPHel coreNLPHel = CoreNLPHel.getInstance();StanfordCoreNLP pipeline = coreNLPHel.getPipeline();Annotation annotation = new Annotation(text);pipeline.annotate(annotation);sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);}// 句子的依赖图(依存分析)public String getDepprasetext() {StringBuffer sb2 = new StringBuffer();for (CoreMap sentence : sentences) {String sentext = sentence.get(CoreAnnotations.TextAnnotation.class);SemanticGraph graph = sentence.get(SemanticGraphCoreAnnotations.BasicDependenciesAnnotation.class);sb2.append(sentext).append("\n");sb2.append(graph.toString(SemanticGraph.OutputFormat.LIST)).append("\n");}return sb2.toString().trim();}// 句子的解析树public String getPrasetext() {StringBuffer sb1 = new StringBuffer();for (CoreMap sentence : sentences) {Tree tree = sentence.get(TreeCoreAnnotations.TreeAnnotation.class);String sentext = sentence.get(CoreAnnotations.TextAnnotation.class);sb1.append(sentext).append("/").append(tree.toString()).append("\n");}return sb1.toString().trim();}
}

四、测试代码

1. 分词测试

public class Test {public static void main(String[] args) {System.out.println(new Segmentation("这家酒店很好,我很喜欢。").getSegtext());System.out.println(new Segmentation("他和我在学校里常打桌球。").getSegtext());System.out.println(new Segmentation("貌似实际用的不是这几篇。").getSegtext());System.out.println(new Segmentation("硕士研究生产。").getSegtext());System.out.println(new Segmentation("我是中国人。").getSegtext());}
}

2. 句子分割测试

public class Test1 {public static void main(String[] args) {String text = "巴拉克·奥巴马是美国总统。他在2008年当选?今年的美国总统是特朗普?普京的粉丝";ArrayList<String> sensRes = new SenSplit(text).getSensRes();for (String str : sensRes) {System.out.println(str);}}
}

3. 词性标注测试

public class Test2 {public static void main(String[] args) {String text = "巴拉克·奥巴马是美国总统。他在2008年当选?今年的美国总统是特朗普?普京的粉丝";System.out.println(new PosTag(text).getPostext());}
}

4. 命名实体识别测试

public class Test3 {public static void main(String[] args) {String text = "巴拉克·奥巴马是美国总统。他在2008年当选?今年的美国总统是特朗普?普京的粉丝";System.out.println(new NamedEntity(text).getNertext());}
}

5. 句法分析测试

public class Test4 {public static void main(String[] args) {String text = "巴拉克·奥巴马是美国总统。他在2008年当选?今年的美国总统是特朗普?普京的粉丝";SPTree spTree = new SPTree(text);System.out.println(spTree.getPrasetext());}
}

五、运行结果

1. 分词结果

这家 酒店 很好 , 我 很 喜欢 。
他 和 我 在 学校 里 常 打 桌球 。
貌似 实际 用 的 不 是 这几 篇 。
硕士 研究 生产 。
我 是 中国 人 。

2. 句子分割结果

巴拉克·奥巴马是美国总统。
他在2008年当选?
今年的美国总统是特朗普?
普京的粉丝

3. 词性标注结果

巴拉克·奥巴马/NNP 是/VC 美国/NNP 总统/NN 。/PU 他/PRP 在/IN 2008年/CD 当选/VBN ?/PU 今年/CD 的/POS 美国/NNP 总统/NN 是/VBP 特朗普/NNP ?/PU 普京/NNP 的/POS 粉丝/NN

4. 命名实体识别结果

巴拉克·奥巴马/PERSON 是/OTHER 美国/LOC 总统/OTHER 。/OTHER 他/OTHER 在/OTHER 2008年/DATE 当选/OTHER ?/OTHER 今年/DATE 的/OTHER 美国/LOC 总统/OTHER 是/OTHER 特朗普/PERSON ?/OTHER 普京/PERSON 的/OTHER 粉丝/OTHER

5. 句法分析结果

巴拉克·奥巴马是美国总统。/(ROOT(S(NP (NNP 巴拉克·奥巴马))(VP (VC 是)(NP (NNP 美国) (NN 总统)))(. 。)))
他在2008年当选?/(ROOT(S(NP (PRP 他))(VP (IN 在)(NP (CD 2008年))(VP (VBN 当选)))(? ?)))
今年的美国总统是特朗普?/(ROOT(S(NP (CD 今年) (DEG 的) (NNP 美国) (NN 总统))(VP (VBP 是)(NP (NNP 特朗普)))(? ?)))
普京的粉丝/ROOT(S(NP (NNP 普京) (DEG 的) (NN 粉丝)))

六、总结

本文详细介绍了如何使用 Stanford CoreNLP 实现中文文本的分词、句子分割、词性标注、命名实体识别和句法分析等功能。通过配置文件和代码实现,我们可以轻松地对中文文本进行处理和分析。这些功能在自然语言处理领域有广泛的应用,如文本分类、情感分析、机器翻译等。

相关文章:

基于 Stanford CoreNLP 的中文自然语言处理

一、概述 Stanford CoreNLP 是斯坦福大学开发的一款强大的自然语言处理&#xff08;NLP&#xff09;工具&#xff0c;支持多种语言的文本处理&#xff0c;包括中文。本文将详细介绍如何使用 Stanford CoreNLP 实现中文文本的分词、词性标注、命名实体识别、句法分析等功能&…...

python 量化交易入门到提升详细教程,python量化交易教程

文章目录 前言入门阶段1. 环境准备安装 Python选择开发环境安装必要的库 2. 金融数据获取3. 简单策略构建 - 移动平均线交叉策略 进阶阶段1. 策略回测2. 风险管理3. 多因子策略4. 机器学习在量化交易中的应用5. 高频交易策略 前言 Python 作为一门功能强大、易于学习且应用广泛…...

如何设置爬虫的访问频率?

设置爬虫的访问频率&#xff08;即请求间隔&#xff09;是确保爬虫稳定运行并避免对目标服务器造成过大压力的关键步骤。合理的访问频率不仅可以减少被目标网站封禁IP的风险&#xff0c;还能提高爬虫的效率。以下是一些设置爬虫访问频率的方法和最佳实践&#xff1a; 1. 使用s…...

前端循环全解析:JS/ES/TS 循环写法与实战示例

循环是编程中控制流程的核心工具。本文将详细介绍 JavaScript、ES6 及 TypeScript 中各种循环的写法、特性&#xff0c;并通过实际示例帮助你掌握它们的正确使用姿势。 目录 传统三剑客 for 循环 while 循环 do...while 循环 ES6 新特性 forEach for...of for...in 数组…...

大气体育直播模板赛事扁平自适应模板源码

源码名称&#xff1a;大气体育直播模板赛事网站源码 开发环境&#xff1a;帝国cms 7.5 安装环境&#xff1a;phpmysql 模板特点&#xff1a; 程序伪静态版本&#xff0c;实时采集更新&#xff0c;无人值守&#xff0c;省心省力。带火车头采集&#xff0c;可以挂着自动采集发布…...

vue3学习1

vite是新的官方构建工具&#xff0c;构建速度比webpack更快 vue项目的入口文件是index.html&#xff0c;一般在这里引入src/main.js&#xff0c;并且设置好容器#app App.vue放的是根组件&#xff0c;components里放分支组件 vue组件中写三种标签&#xff0c;template & s…...

java机器学习计算指标动态阈值

java机器学习计算指标动态阈值 最近听到有的人说要做机器学习就一定要学Python&#xff0c;我想他们掌握的知道还不够系统全面。本文作者以动态阈值需求场景给大家介绍几种常用Java实现的机器学习库&#xff0c;包括使用开源库如Weka或Deeplearning4j&#xff08;DL4J&#xf…...

mac os设置jdk版本

打开环境变量配置文件 sudo vim ~/.bash_profile 设置不同的jdk版本路径 # 设置JAVA_HOME为jdk17路径 export JAVA_HOME$(/usr/libexec/java_home -v 17)# 设置JAVA_HOME为jdk8路径 export JAVA_HOME$(/usr/libexec/java_home -v 1.8) 设置环境变量 # 将jdk加入到环境变量…...

Python正则表达式学习

Python正则表达式全攻略 一、正则表达式基础 1. 什么是正则表达式&#xff1f; 用于描述字符串匹配规则的表达式广泛应用于文本处理、表单验证、数据清洗等领域 2. Python中的re模块 import re3. 基础语法 字符说明示例.匹配任意字符(除换行)a.c → abc\d数字 [0-9]\d\d …...

ShenNiusModularity项目源码学习(10:ShenNius.FileManagement项目分析)

ShenNiusModularity项目支持七牛云和本地图片存储&#xff0c;其文件上传接口及实现就位于ShenNius.FileManagement项目内&#xff0c;该项目内文件不多&#xff0c;主要就是围绕上传本地及七牛云的实现及相关类定义。   扩展类FileManagemenServiceExtensions的AddFileUploa…...

mysql查看binlog日志

mysql 配置、查看binlog日志&#xff1a; 示例为MySQL8.0 1、 检查binlog开启状态 SHOW VARIABLES LIKE ‘log_bin’; 如果未开启&#xff0c;修改配置my.ini 开启日志 安装目录配置my.ini(mysql8在data目录) log-binmysql-bin&#xff08;开启日志并指定日志前缀&#xff…...

Node.js高频面试题精选及参考答案

目录 什么是 Node.js?它的主要特点有哪些? Node.js 的事件驱动和非阻塞 I/O 模型是如何工作的? 为什么 Node.js 适合处理高并发场景? Node.js 与传统后端语言(如 Java、Python)相比,有哪些优势和劣势? 简述 Node.js 的运行原理,包括 V8 引擎的作用。 什么是 Nod…...

TaskBuilder创建客户信息列表页面

3.4.1选择页面类型 点击上面创建的customer文件夹右侧的加号&#xff0c;打开“前端资源创建向导”对话框&#xff0c;选中“数据查询TFP”&#xff0c;资源名称会自动设置为index&#xff0c;这里我们不用改。 点“下一步”按钮&#xff0c;会弹出下图所示的“创建数据查询T…...

Linux Iptables示例一则

个人博客地址&#xff1a;Linux Iptables示例一则 | 一张假钞的真实世界 关于Iptables的介绍个人强烈推荐&#xff1a;iptables-朱双印博客-第2页。这位兄弟介绍的很详细。 我个人的需求是在同一个网络内从网络上把测试主机与正式环境主机间的网络进行隔离。我的思路是采用OU…...

新手小白如何挖掘cnvd通用漏洞之存储xss漏洞(利用xss钓鱼)

视频教程和更多福利在我主页简介或专栏里 &#xff08;不懂都可以来问我 专栏找我哦&#xff09; 如果对你有帮助你可以来专栏找我&#xff0c;我可以无偿分享给你对你更有帮助的一些经验和资料哦 目录&#xff1a; 一、XSS的三种类型&#xff1a; 二、XSS攻击的危害&#x…...

【CXX】4 跨平台构建系统特性对比

多语言构建系统选项为开发团队提供了灵活性和选择&#xff0c;以适应不同的项目需求和现有的技术栈。CXX作为一个设计灵活的工具&#xff0c;旨在与多种构建系统无缝集成。以下是对不同构建系统选项的简要概述和建议&#xff1a; 一、Cargo&#xff1a; 适用场景&#xff1a;…...

MySQL 如何使用EXPLAIN工具优化SQL

EXPLAIN 是 SQL 查询优化中的一个重要工具&#xff0c;主要用于分析和诊断查询执行计划。通过 EXPLAIN&#xff0c;我们可以了解数据库引擎&#xff08;如 MySQL、PostgreSQL 等&#xff09;是如何执行特定的查询语句的&#xff0c;包括是否使用了索引、表连接的方式、扫描的行…...

沃丰科技大模型标杆案例|周大福集团统一大模型智能服务中心建设实践

沃丰科技携手老客户周大福如何进行统一大模型智能服务中心建设‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ “我们相信&#xff0c;科技与创新是推动珠宝行业持续发展的关键力量。”——周大福珠宝集团董事总经理黄绍基。这句话再次强调了科技与创新在珠宝行业发展中的重要性&…...

代码随想录day16

513.找树左下角的值 //迭代法中左视图的最后一位 int findBottomLeftValue(TreeNode* root) {int result 0;queue<TreeNode*> qe;if(root nullptr) return result;qe.push(root);vector<int> lefts;while(!qe.empty()){int sz qe.size();vector<int> tmp…...

常见的软件测试模型及特点

软件测试模型有多种&#xff0c;常见的包括以下几种&#xff0c;每种模型都有其特点和适用场景&#xff1a; 1. V 模型&#xff08;V-Model&#xff09; 特点&#xff1a; 测试和开发并行进行&#xff0c;开发的每个阶段都有对应的测试活动。适用于需求明确、开发过程较规范的…...

Java 语言特性(面试系列2)

一、SQL 基础 1. 复杂查询 &#xff08;1&#xff09;连接查询&#xff08;JOIN&#xff09; 内连接&#xff08;INNER JOIN&#xff09;&#xff1a;返回两表匹配的记录。 SELECT e.name, d.dept_name FROM employees e INNER JOIN departments d ON e.dept_id d.dept_id; 左…...

设计模式和设计原则回顾

设计模式和设计原则回顾 23种设计模式是设计原则的完美体现,设计原则设计原则是设计模式的理论基石, 设计模式 在经典的设计模式分类中(如《设计模式:可复用面向对象软件的基础》一书中),总共有23种设计模式,分为三大类: 一、创建型模式(5种) 1. 单例模式(Sing…...

逻辑回归:给不确定性划界的分类大师

想象你是一名医生。面对患者的检查报告&#xff08;肿瘤大小、血液指标&#xff09;&#xff0c;你需要做出一个**决定性判断**&#xff1a;恶性还是良性&#xff1f;这种“非黑即白”的抉择&#xff0c;正是**逻辑回归&#xff08;Logistic Regression&#xff09;** 的战场&a…...

2025年能源电力系统与流体力学国际会议 (EPSFD 2025)

2025年能源电力系统与流体力学国际会议&#xff08;EPSFD 2025&#xff09;将于本年度在美丽的杭州盛大召开。作为全球能源、电力系统以及流体力学领域的顶级盛会&#xff0c;EPSFD 2025旨在为来自世界各地的科学家、工程师和研究人员提供一个展示最新研究成果、分享实践经验及…...

练习(含atoi的模拟实现,自定义类型等练习)

一、结构体大小的计算及位段 &#xff08;结构体大小计算及位段 详解请看&#xff1a;自定义类型&#xff1a;结构体进阶-CSDN博客&#xff09; 1.在32位系统环境&#xff0c;编译选项为4字节对齐&#xff0c;那么sizeof(A)和sizeof(B)是多少&#xff1f; #pragma pack(4)st…...

鱼香ros docker配置镜像报错:https://registry-1.docker.io/v2/

使用鱼香ros一件安装docker时的https://registry-1.docker.io/v2/问题 一键安装指令 wget http://fishros.com/install -O fishros && . fishros出现问题&#xff1a;docker pull 失败 网络不同&#xff0c;需要使用镜像源 按照如下步骤操作 sudo vi /etc/docker/dae…...

自然语言处理——Transformer

自然语言处理——Transformer 自注意力机制多头注意力机制Transformer 虽然循环神经网络可以对具有序列特性的数据非常有效&#xff0c;它能挖掘数据中的时序信息以及语义信息&#xff0c;但是它有一个很大的缺陷——很难并行化。 我们可以考虑用CNN来替代RNN&#xff0c;但是…...

【JavaSE】绘图与事件入门学习笔记

-Java绘图坐标体系 坐标体系-介绍 坐标原点位于左上角&#xff0c;以像素为单位。 在Java坐标系中,第一个是x坐标,表示当前位置为水平方向&#xff0c;距离坐标原点x个像素;第二个是y坐标&#xff0c;表示当前位置为垂直方向&#xff0c;距离坐标原点y个像素。 坐标体系-像素 …...

IoT/HCIP实验-3/LiteOS操作系统内核实验(任务、内存、信号量、CMSIS..)

文章目录 概述HelloWorld 工程C/C配置编译器主配置Makefile脚本烧录器主配置运行结果程序调用栈 任务管理实验实验结果osal 系统适配层osal_task_create 其他实验实验源码内存管理实验互斥锁实验信号量实验 CMISIS接口实验还是得JlINKCMSIS 简介LiteOS->CMSIS任务间消息交互…...

selenium学习实战【Python爬虫】

selenium学习实战【Python爬虫】 文章目录 selenium学习实战【Python爬虫】一、声明二、学习目标三、安装依赖3.1 安装selenium库3.2 安装浏览器驱动3.2.1 查看Edge版本3.2.2 驱动安装 四、代码讲解4.1 配置浏览器4.2 加载更多4.3 寻找内容4.4 完整代码 五、报告文件爬取5.1 提…...