Doccano is an open source text annotation tool. It can be used to create labeled datasets for:
- Text classification
- Entity extraction
- Sequence to sequence translation
Doccano can be used to create labeled data for training the EntityRecongnizer
model in arcgis.learn
.
This software is created by: Hiroki Nakayama and Takahiro Kubo and Junya Kamura and Yasufumi Taniguchi and Xu Liang
Deploying doccano for data labeling
For Windows
Method 1 (Using docker desktop requires Microsoft Windows 10 Professional or Enterprise 64-bit):
- Install docker for desktop.
- Launch Command Prompt(cmd.exe) as Administrator and run the below commands:
docker pull doccano/doccano:1.2.0
docker container create --name doccano -e "ADMIN_USERNAME=admin" -e "ADMIN_EMAIL=admin@example.com" -e "ADMIN_PASSWORD=password" -p 8000:8000 doccano/doccano:1.2.0
docker start doccano
- You can now access Doccano at http://localhost:8000
Method 2:
- Download or clone the arcgis-python-api githup repo.
- Navigate to
misc/tools/doccano_deployment
folder. - Run install.bat as administrator.
- On the command prompt, you will be asked to create your username and password for accessing Doccano.
- Once the install script completes, you should have Doccano running on your local system.
- Open your browser and go to http://localhost:8000/
For Linux
- Install Docker Engine (Community) for your linux distribution.
- Launch a terminal and run the below commands:
sudo docker pull doccano/doccano:1.2.4
sudo docker container create --name doccano -e "ADMIN_USERNAME=admin" -e "ADMIN_EMAIL=admin@example.com" -e "ADMIN_PASSWORD=password" -p 80:8000 doccano/doccano:1.2.4
docker start doccano
- You can modify the ADMIN_USERNAME, ADMIN_EMAIL and ADMIN_PASSWORD values.
- You can now access Doccano at http://localhost:8000
How to label training data for named entity recognition with doccano.
- After Doccano has been deployed to the local machine, go to Doccano hompage and login with your credentials.
- Create new project with project type 'Sequence labeling':
- To import data for annotation, go to Dataset from the left panel then click on Actions > Import dataset.
-
Select 'JSONL' and then click on 'Select file(s)' and point it to the reports file (docanno_deployment\reports_label.jsonl). Alternatively, text documents can also be uploaded using the ‘Plain text’ option.
-
After the file has been imported, you will see the documents loaded on the screen.
-
Click on 'Start annotation' from the top menu bar.
-
All the documents are pre-labeled, just 3 (document number 2,3 & 4) are intentionally left unlabeled for you to try labeling. Analyze the first labeled document and then move on to second document (use the bottom navigation bar for sifting through the docs). Mark sequences with your mouse and select the relevant title.
-
New labels can also be created by navigating to ‘Labels’ from the ;eft panel.
-
Once all the documents have been labeled, go to 'Dataset' > 'Actions' > 'Export dataset'.
-
Select JSONL(Text-Labels).
-
Set an export file name.
-
Click Export.
The downloaded file can be used to train an EntityRecognizer
model from arcgis.learn
. You can find a sample notebook here