Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read annotated data with Doccano #7

Open
asriabdelhakim opened this issue Mar 10, 2019 · 0 comments
Open

Read annotated data with Doccano #7

asriabdelhakim opened this issue Mar 10, 2019 · 0 comments

Comments

@asriabdelhakim
Copy link

Hi,
Please how can i read my annotated data with another tool named Doccano.
1) Here is my annotated data's form:

"annotation": [
[
79,
99,
"Nom complet"
],

2) The code that i want to change to read my annotated data:

    for line in lines:
        data = json.loads(line)
        text = data['content']
        entities = []
        for annotation in data['annotation']:
            #only a single point in text annotation.
            point = annotation['points'][0]
            labels = annotation['label']
            # handle both list of labels or a single label.
            if not isinstance(labels, list):
                labels = [labels]

            for label in labels:
                #dataturks indices are both inclusive [start, end] but spacy is not [start, end)
                entities.append((point['start'], point['end'] + 1 ,label))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant