How to Define New Relation Types in Doccano: A Step-by-Step Guide
Doccano is a powerful annotation tool used for training machine learning models. It allows users to annotate text data with various types of annotations, including entity and relation annotations. In this guide, we will focus on defining new relation types in Doccano.
Step 1: Accessing the Annotation Project
Before defining new relation types, you need to have an active annotation project in Doccano. Log in to your Doccano account and navigate to the project you want to work on.
Step 2: Opening the Relation Type Editor
Once you are in the annotation project, locate the "Settings" tab in the top navigation bar. Click on it to access the project settings. In the settings page, you will find the "Relation Types" section. Click on the "Edit" button next to it to open the relation type editor.
Step 3: Adding a New Relation Type
In the relation type editor, you will see a list of existing relation types. To define a new relation type, click on the "Add Relation Type" button. A form will appear where you can enter the details of the new relation type.
Start by providing a unique name for the relation type in the "Name" field. Choose a name that clearly represents the semantic relationship you want to define. For example, if you are annotating relationships between people and organizations, you can name the relation type "WorksAt".
Next, specify the "Color" for the relation type. This color will be used to highlight the relation annotations in the annotation interface. Click on the color picker to choose a color that stands out and is easily distinguishable from other relation types.
Finally, you can add an optional description for the relation type in the "Description" field. This can be helpful for other annotators to understand the purpose and usage of the relation type.
Step 4: Saving the New Relation Type
Once you have filled in the details of the new relation type, click on the "Save" button to save it. The new relation type will now be available for annotation in your project.
Step 5: Annotating Relations
To start annotating relations using the newly defined relation type, go back to the annotation interface of your project. Select a text span that represents the relation and click on the "Relation" button in the toolbar. A dropdown menu will appear with the list of available relation types, including the one you just defined.
Select the appropriate relation type from the dropdown menu. Then, click on the first entity involved in the relation and drag the cursor to the second entity. This will create a relation annotation between the two entities using the selected relation type.
Step 6: Reviewing and Exporting Annotations
After annotating relations, you can review and modify the annotations in the annotation interface. Doccano provides various tools for reviewing and correcting annotations, such as the ability to merge or split annotations.
Once you are satisfied with the annotations, you can export them for further analysis or training machine learning models. Doccano supports exporting annotations in different formats, including JSON and CSV.
Conclusion
Defining new relation types in Doccano is a straightforward process that allows you to customize the annotation tool according to your specific annotation needs. By following the step-by-step guide outlined above, you can easily define and annotate relations using your own relation types. This flexibility makes Doccano a versatile tool for training machine learning models on text data.
References
| Source | Link |
|---|---|
| Doccano Documentation | https://doccano.readthedocs.io/ |