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

仿站多少钱dz论坛可以做招聘网站

仿站多少钱,dz论坛可以做招聘网站,wordpress教学模板,微网站建设定制网站建设一、说明 Python 有一些非常强大的 NLP 库#xff0c;NLTK — 自然语言工具包 — NLTK 是一个强大的开源库#xff0c;用于 NLP 的研究和开发。它内置了 50 多个文本语料库和词汇资源。它支持文本标记化、词性标记、词干提取、词形还原、命名实体提取、分割、分类、语义推理。… 一、说明 Python 有一些非常强大的 NLP 库NLTK — 自然语言工具包 — NLTK 是一个强大的开源库用于 NLP 的研究和开发。它内置了 50 多个文本语料库和词汇资源。它支持文本标记化、词性标记、词干提取、词形还原、命名实体提取、分割、分类、语义推理。 SpaCY — SpaCy 也是一个开源 Python 库用于构建现实世界项目的生产级别。它内置了对 BERT 等多重训练 Transformer 的支持以及针对超过 17 种语言的预训练 NLP 管道。它速度非常快并提供以下功能 - 超过 49 种语言的标记化、词性标记、分段、词形还原、命名实体识别、文本分类。 TextBlob — TextBlob 是一个构建在 NLTK 之上的开源库。它提供了一个简单的界面并支持诸如情感分析、短语提取、解析、词性标记、N-gram、拼写纠正、标记分类、名词短语提取等任务。 Gensim — GenSim 支持分层狄利克雷过程 (HDP)、随机投影、潜在狄利克雷分配 (LDA)、潜在语义分析或 word2vec 深度学习等算法。它非常快并且优化了内存使用。 PolyGlot — PolyGlot 支持多种语言并基于 SpaCy 和 NumPy 库构建。它支持165种语言的标记化、196种语言的语言检测、命名实体识别、POS标记、情感分析、137种语言的词嵌入、形态分析、69种语言的音译。 sklearn — Python 中的标准机器学习库 自然语言工具包NLTK NLTK 是一个免费的开源 Python 库用于在 Windows、Mac OS X 和 Linux 中构建 NLP 程序。它拥有 50 个内置语料库、WordNet 等词汇资源以及许多用于 NLP 任务如分类、标记化、词干提取、标记、解析、语义推理的库。 NLTK 提供了编程基础知识、计算语言学概念和优秀文档的实践指南这使得 NLTK 非常适合语言学家、工程师、学生、教育工作者、研究人员和行业用户等使用。NLTK 有一本姊妹书——由 NLTK 的创建者编写的《Python 自然语言处理》。 下载并安装NLTK # using pip: pip install nltk # using conda: conda install nltk 二、NLTK数据下载  数据下载地址这里 NLTK附带了许多语料库、玩具语法、训练模型等。安装NLTK后我们应该使用NLTK的数据下载器安装数据 import nltk nltk.download() 应打开一个新窗口显示 NLTK 下载程序。您可以选择要下载的语料库。您也可以下载全部。 NLTK 包括一组不同的语料库可以使用 nltk.corpus 包读取。每个语料库都通过 nltk.corpus 中的“语料库阅读器”对象进行访问 # Builtin corpora in NLTK (https://www.nltk.org/howto/corpus.html) import nltk.corpus from nltk.corpus import brown brown.fileids() 每个语料库阅读器都提供多种从语料库读取数据的方法具体取决于语料库的格式。例如纯文本语料库支持将语料库读取为原始文本、单词列表、句子列表或段落列表的方法。 from nltk.corpus import inaugural inaugural.raw(1789-Washington.txt) 三、单词列表和词典 NLTK 数据包还包括许多词典和单词列表。这些的访问就像文本语料库一样。以下示例说明了词表语料库的使用 from nltk.corpus import words words.fileids() 停用词对文本含义添加很少或没有添加的单词。 from nltk.corpus import stopwords stopwords.fileids() 四、语料库与词典 语料库是特定语言的文本数据书面或口头的大量集合。语料库可能包含有关单词的附加信息例如它们的 POS 标签或句子的解析树等。 词典是语言的词位词汇的整个集合。许多词典包含一个核心标记lexeme、其名词形式、形容词形式、相关动词、相关副词等、其同义词、反义词等。 NLTK提供了一个opinion_lexicon其中包含英语正面和负面意见词的列表 from nltk.corpus import opinion_lexicon opinion_lexicon.negative()[:5] 五、NLTK 中的简单 NLP 任务 # Tokenization from nltk import word_tokenize, sent_tokenize sent I will walk 500 miles and I would walk 500 more, just to be the man who walks a thousand miles to fall down at your door! print(word_tokenize(sent)) print(sent_tokenize(sent)) #Stopwords removal from nltk.corpus import stopwords # the corpus module is an extremely useful one. sent I will pick you up at 5.00 pm. We will go for a walk stop_words stopwords.words(english) # this is the full list of all stop-words stored in nltk token nltk.word_tokenize(sent) cleaned_token [] for word in token:if word not in stop_words:cleaned_token.append(word) print(This is the unclean version:, token) print(This is the cleaned version:, cleaned_token) # Stemming from nltk.stem import PorterStemmer stemmer PorterStemmer() print(stemmer.stem(feet)) # Lemmatization import nltk from nltk.stem.wordnet import WordNetLemmatizer lemmatizer WordNetLemmatizer() print(lemmatizer.lemmatize(feet)) # POS tagging from nltk import pos_tag from nltk.corpus import stopwords stop_words stopwords.words(english)sentence The pos_tag() method takes in a list of tokenized words, and tags each of them with a corresponding Parts of Speech tokens nltk.word_tokenize(sentence)cleaned_token [] for word in tokens:if word not in stop_words:cleaned_token.append(word) tagged pos_tag(cleaned_token) print(tagged) 六、命名实体识别  NER 是 NLP 任务用于定位命名实体并将其分类为预定义的类别例如人名、组织、位置、时间表达、数量、货币价值、百分比等。它有助于回答如下问题 报告中提到了哪些公司该推文是否谈到了特定的人新闻文章中提到了哪些地方、哪些公司正在谈论哪种产品 entities nltk.chunk.ne_chunk(tagged) entities 七、WordNet 语料库阅读器 WordNet 是 WordNet 的 NLTK 接口。WordNet 是英语词汇数据库。WordNet 使用 Synsets 来存储单词。同义词集是一组具有共同含义的同义词。使用同义词集它有助于找到单词之间的概念关系。 八、使用 NLTK 朴素贝叶斯分类器构建电影评论分类器 import nltk import string #from nltk.tokenize import sent_tokenize, word_tokenize from nltk.corpus import stopwords from nltk.corpus import movie_reviewsneg_files movie_reviews.fileids(neg) pos_files movie_reviews.fileids(pos)def feature_extraction(words):stopwordsandpunct nltk.corpus.stopwords.words(english) list(string.punctuation)return { word:present for word in words if not word in stopwordsandpunct}neg_words [(feature_extraction(movie_reviews.words(fileids[f])), neg) for f in neg_files] pos_words [(feature_extraction(movie_reviews.words(fileids[f])), pos) for f in pos_files]from nltk.classify import NaiveBayesClassifier #load the buildin classifier clf NaiveBayesClassifier.train(pos_words[:500]neg_words[:500]) #train it on 50% of records in positive and negative reviews nltk.classify.util.accuracy(clf, pos_words[500:]neg_words[500:])*100 #test it on remaining 50% recordsclf.show_most_informative_features()
http://www.hkea.cn/news/14372679/

相关文章:

  • 企业网站开发公司有哪些网络服务器有哪些
  • 贵州省住房和城乡建设厅网站(深汕特别合作区面积
  • 绍兴建设公司网站轻量wordpress主题
  • 怎么看网站pr值博兴做网站
  • 最好的汽车科技网站建设Wordpress慢加内存还是带宽
  • 昆山正规网站建设不是固定ip如何做网站
  • 嘉兴seo公司网站北京保障房建设项目网站
  • 网站备案简介怎么写无锡网站关键词优化软件咨询
  • 做测评的网站营销型网站建设规划书
  • 青岛找网站建设公司哪家好wordpress unknown
  • 网站建设模板下载免费设计制作图片
  • 网站首页轮播图片小学生课程同步做网站软件
  • 查网站权重邢台网站建设哪儿好
  • 网站开发总结多企业宣传网站建设
  • 肥西县建设局资询网站什么源码做有趣的网站
  • 在技校计算机网站建设东莞网站建设音乐盒
  • 大专电子商务主要学什么博客seo优化技术
  • 一条龙建站多少钱刷关键词怎么刷
  • 网站项目申请网站建设公司如何转型
  • 建设棋牌网站流程搜索引擎营销概念
  • 租车网站开发现在做网站都是怎么做的
  • 用二级域名做网站对seo企业安全文化的建设方案
  • 珠海市网站建设典当行网站
  • photoshop网站视觉设计步骤成全视频在线直播观看
  • 网站对比中国互联网平台
  • 免费网站重生做军嫂网站建站论坛
  • 申请付费网站石家庄网站制作费用
  • 现在用什么做网站个人网站建设实训报告
  • 网站开发服务内容wordpress安装视频
  • 怎么申请网站空间域名it运维发展方向