丹麦柠檬汁

lemm的Python项目详细描述


勒米

莱米是丹麦和瑞典的一种柠檬汁。它随时可以使用。这个 丹麦模型是在dansk sprogn_vn(dsn)单词表(“fuldformliste”)和 Danish Universal Dependencies。 瑞典模型是在SALDO's morphology数据集和瑞典 Universal Dependencies (Talbanken)。莱米也 支持在自己的数据集上进行培训。

lemmy中包含的模型是根据各自的通用依赖项dev 数据集。丹麦模式得分为99%,瑞典模式得分为97%。 所有报告的分数都是在向Lemmy提供POS标签时获得的。

可以将lemmy用作spacy扩展,更具体地说,是spacy管道组件。 这是强烈推荐的,并且使得从spacy令牌很容易访问引理。 lemmy利用pos标签预测引理。当连接到Spacy管道时, Lemmy有使用Spacy内置pos标记器的好处。

狐猴也可以通过使用没有空间,作为一个独立的狐猴。那样的话,你会 必须提供POS标签。或者,你可以使用不带POS标签的Lemmy 最有可能的是准确性会受到影响。目前,只有丹麦的莱米模型 没有POS标签的模型。也就是说,如果你想在瑞典语中使用lemmy 没有pos标签的文本,你必须训练自己的lemmy模型。

莱米深受CST Lemmatizer for Danish的启发。

安装

pip install lemmy

不带POS标签的基本用法

importlemmy# Create an instance of the standalone lemmatizer.lemmatizer=lemmy.load("da")# Find lemma for the word 'akvariernes'. First argument is an empty POS tag.lemmatizer.lemmatize("","akvariernes")

POS标签的基本用法

importlemmy# Create an instance of the standalone lemmatizer.# Replace 'da' with 'sv' for the Swedish lemmatizer.lemmatizer=lemmy.load("da")# Find lemma for the word 'akvariernes'. First argument is the user-provided POS tag.lemmatizer.lemmatize("NOUN","akvariernes")

使用Spacy型号

importda_custom_modelasda# replace da_custom_model with name of your spaCy modelimportlemmy.pipenlp=da.load()# Create an instance of Lemmy's pipeline component for spaCy.# Replace 'da' with 'sv' for the Swedish lemmatizer.pipe=lemmy.pipe.load('da')# Add the component to the spaCy pipeline.nlp.add_pipe(pipe,after='tagger')# Lemmas can now be accessed using the `._.lemmas` attribute on the tokens.nlp("akvariernes")[0]._.lemmas

培训

notebooks文件夹包含演示如何使用 莱米。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java ActiveMQ 5.9.0、Glassfish 3.1.2和MDB用于长时间的消息处理   从main调用的对象数组的Java字符串表示形式   java如何在iText 7中为泰国字母上方的双标记设置GPO   编译如果Java6工件是用Java6、7或8编译的,这有关系吗?   image Java KeyListener未检测到键盘输入   java找不到符号(构造函数)   java如何使Kafka使用者从特定主题分区读取Spring Boot   Java readLine()返回null   从CSV文件计算值时出现java系统错误   java如何避免处理程序。被调用后延迟(可运行运行)?   Java Do和While验证   java如何访问父类型的ArrayList中的子方法?   java如何使用Deepfirstsearch算法获得最高级别的搜索   xml使用SAX解析器Java正确构建字符串   Android片段中的java Toast显示空指针expn   如何在java中将多个文件合并到另一个新文件中?   java在运行时在JVisualVM中更改应用程序的标题   javajavax。命名。NoInitialContextException:需要在环境或sys中指定类名