数据标注工具 doccano | 文本分类(Text Classification)

数据标注工具 Label-Studio

安装

打开命令行(cmd、terminal)执行安装命令

# Python 3.8+
pip install doccano -i https://pypi.tuna.tsinghua.edu.cn/simplelabel

image

运行 doccano

#在电脑第一次运行的时候初始化doccano
#只需设置一次,之后不用再运行该命令
doccano init

#创建用户名及密码;例如现在有一个主管admin,1个标注员vipsoft
doccano createuser --username admin --password 123456
doccano createuser --username vipsoft --password 123456

#开启doccano服务
doccano webserver

完成上述操作后,另打开一个新的命令行,执行下列命令

# In another terminal, run the command:
doccano task

image
image

重运行 doccano

#开启doccano服务
doccano webserver

另打开一个新的命令行,执行下列命令

# In another terminal, run the command:
doccano task

打开 doccanno

在浏览器里输入:http://localhost:8000/ 支持中文,挺好
image
输入用户名密码:
image

创建项目

创建分类式任务

如图点击Create按钮。根据需要选择合适的项目类别,这里选择 文本分类 Text Classification
image
image
image

上传数据

实验数据下载:https://hidadeng.github.io/blog/doccano_text_anotation/data.csv
image

上传数据
image
下面的 review 对应 csv 里的列
image
image

定义标签

击左侧菜单中的“Labels”按钮来定义我们的标签。我们看到标签编辑器页面。在标签编辑器页面中,您可以通过指定标签文本、快捷键、背景颜色和文本颜色来创建标签。
image
同理,可以定义负面neg标签。现在有了pos和neg两个标签。
image

添加成员

点击左侧目录中的 Members 按钮,然后,选择“Add”按钮以显示表单。使用您要添加到项目中的用户名和角色填写此表单。然后,选择“Save”按钮。如果没有可供选择的成员,记得创建成员。doccano createuser --username tom --password 123456
image

开始标注

点击导航栏中的Start annotation按钮,开始对文档进行批注了
image

导出数据

到“Dataset”页面,然后单击“操作”菜单中的“Export dataset”按钮。选择导出格式后,单击“Export”。
image

查看数据

import pandas as pd

df = pd.read_csv('all.csv')
df

image

统计

image

posted @ 2024-06-20 11:16  VipSoft  阅读(262)  评论(0编辑  收藏  举报