Doccano
doccano 是一個面向人類的開源文本注釋工具。它為文本分類、序列標記和序列到序列任務提供注釋功能。您可以創(chuàng)建用于情感分析、命名實體識別、文本摘要等的標記數(shù)據(jù)。只需創(chuàng)建一個項目,上傳數(shù)據(jù),然后開始注釋。您可以在數(shù)小時內(nèi)構(gòu)建數(shù)據(jù)集。
支持命名實體識別,情感分類,機器翻譯任務,界面比較友好。
- 當前公司私有化部署的地址:(
當前掛掉了,后端處理中) - git:https://github.com/doccano/doccano
技術(shù)方案
前端:vue2 + nuxt
后端:python
技術(shù)難點
- 標注工具編輯器部分組件
功能:
- 支持標注 Label
- 支持關(guān)系 Relation
開源組件:
- vue 組件:
-
- https://www.npmjs.com/package/v-annotator
- https://github.com/doccano/v-annotator/blob/master/package.json
- demo:https://github.com/doccano/doccano/blob/93cfd52924378bd2c8e109fff2b072199ff2e8bc/frontend/pages/demo/named-entity-recognition/index.vue
<v-annotator
:dark="$vuetify.theme.dark"
:rtl="rtl"
:text="text" //文本內(nèi)容
:entities="entities" // 注解內(nèi)容
:entity-labels="entityLabels" // 注解標簽
:relations="relations"http:// 關(guān)系內(nèi)容
:relation-labels="relationLabels" // 關(guān)系標簽
:allow-overlapping="allowOverlapping"
:grapheme-mode="graphemeMode"
:selected-entities="selectedEntities"
@add:entity="handleAddEvent" // 添加注解內(nèi)容
@click:entity="onEntityClicked" // 點擊注解
@click:relation="onRelationClicked" // 點擊關(guān)系
@addRelation="addRelation" // 添加 關(guān)系
@contextmenu:entity="deleteEntity" // 右鍵菜單點擊
@contextmenu:relation="deleteRelation" // 右鍵菜單點擊
/>
<entity-editor
:dark="$vuetify.theme.dark"
:rtl="rtl"
:text="currentDoc.text"
:entities="currentDoc.annotations"
:entity-labels="entityLabels"
:relations="relations"
:relation-labels="relationLabels"
:allow-overlapping="allowOverlapping"
@addEntity="addEntity"
@click:entity="updateEntity"
@contextmenu:entity="deleteEntity"
@contextmenu:relation="deleteRelation"
/>
- react 組件
https://github.com/microsoft/react-text-annotator
當前看 v-annotator 是 doccanno 封裝的一個組件,react 這個組件要分析一下是不是支持當前的特性
代碼如下:
import {AnnotationData, Labeler} from 'react-text-annotator'
const HomePage: React.FC = () => {
const annotations: AnnotationData[] = [
{
id: 'id1',
color: 'red',
endToken: 5,
startToken: 0,
name: 'label111111',
kind: 'label',
onClick:(e) => {
console.log(e);
},
level: 1,// 設置層級
onRenderTooltip: (e) =><>label111111</>
},{
id: 'id1',
color: 'green',
endToken: 5,
startToken: 1,
name: 'label222222',
kind: 'label',
onRenderTooltip: (e) =><>label222222</>
},
{
id: 'id2',
color: 'blue',
endToken: 25,
startToken: 10,
name: 'relation',
kind: 'relation',
}
];
const labelerText = 'This is sample text to test the labeler functionality.';
return <>
<Labeler text={labelerText} annotations={annotations} labelerConfigs={{ isAnnotationResizingEnabled: true,isRtl: false, tokenizationType: 'character' }}
labelerOverflow={'scroll'}
labelerHeight={"100px"}
/>
</>;
};
export default HomePage;
下面的了解即可
YEDDA:(2016)(python)
優(yōu)點是安裝方便,程序很小,標注方便,如果要實現(xiàn)給同一個實體加多個標簽,也可以實現(xiàn)。最大標簽數(shù)8,界面也還過的去。
YEDDA(以前的 SUTDAnnotator)是為在文本(幾乎所有語言,包括英語、中文)、符號甚至表情符號上注釋塊/實體/事件而開發(fā)的。它支持快捷注釋,對于手動注釋文本非常有效。用戶只需選擇文本范圍并按快捷鍵,該范圍就會自動注釋。它還支持命令注釋模型,可以批量注釋多個實體,并支持將注釋文本導出為序列文本。此外,更新版本還增加了智能推薦和管理員分析。它兼容所有主流操作系統(tǒng),包括Windows、Linux和MacOS。
https://github.com/jiesutd/YEDDA
python
Prodigy(2017):
Prodigy 是一種現(xiàn)代注釋工具, 用于為機器學習模型創(chuàng)建訓練和評估數(shù)據(jù)。您還可以使用 Prodigy 來幫助您檢查和清理數(shù)據(jù)、進行錯誤分析以及開發(fā)基于規(guī)則的系統(tǒng)以與統(tǒng)計模型結(jié)合使用。
https://prodi.gy/docs/
Python library
Chinese-Annotator:(2017)
基于prodigy的中文標注工具
https://github.com/deepwel/Chinese-Annotator
demo:https://demo.prodi.gy/?=null&view_id=textcat
技術(shù)方案:
- vue2 element
- Python
Brat:(2010)
支持實體、關(guān)系、事件抽取的標注??梢詷俗⑶楦?。
優(yōu)點在標注實體的同時可以進行關(guān)系標注,還可以實現(xiàn)二級標注。
brat rapid annotation tool
GitHub - nlplab/brat: brat rapid annotation tool (brat) - for all your textual annotation needs
技術(shù)方案
- jq
- Python
IEPY
主要用來信息抽取和關(guān)系抽取任務
https://github.com/machinalis/iepy
DeepDive
主要用來關(guān)系抽取任務,17就停止更新了
http://deepdive.stanford.edu/#documentation
個人小結(jié)
大致可以選用Brat,Doccano,YEDDA,Prodigy試一下,選用Brat是因為有現(xiàn)成的中文情感標注,還有Brat有關(guān)系標注,選用Doccano是它的頁面很友好,而且可添加的標簽數(shù)也比較多,選用YEDDA是它完全用Python桌面開發(fā)且支持中文,選用Prodigy是因為支持標注的功能最全。
中文分詞工具(分詞工具有的也可以做命名實體識別和詞性標注,可以去看看)
中科院計算所NLPIR http://ictclas.nlpir.org/nlpir/
ansj分詞器 https://github.com/NLPchina/ansj_seg
哈工大的LTP https://github.com/HIT-SCIR/ltp
清華大學THULAC https://github.com/thunlp/THULAC
斯坦福分詞器 https://nlp.stanford.edu/software/segmenter.shtml
Hanlp分詞器 https://github.com/hankcs/HanLP
結(jié)巴分詞 https://github.com/yanyiwu/cppjieba
KCWS分詞器(字嵌入+Bi-LSTM+CRF) https://github.com/koth/kcws
ZPar https://github.com/frcchang/zpar/releases文章來源:http://www.zghlxwxcb.cn/news/detail-685877.html
IKAnalyzer https://github.com/wks/ik-analy文章來源地址http://www.zghlxwxcb.cn/news/detail-685877.html
到了這里,關(guān)于文本標注技術(shù)方案(NLP標注工具)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!