# Trouble with blocks annotation api

**URL:** <https://support.prodi.gy/t/trouble-with-blocks-annotation-api/3114>\
**Category:** Uncategorized\
**Tags:** usage, custom, front-end\
**Created:** [June 30, 2020, 10:59am UTC](https://support.prodi.gy/t/trouble-with-blocks-annotation-api/3114 "2020-06-30T10:59:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniyalSelani](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/daniyalselani/32/1140_2.png) [@daniyalSelani](https://support.prodi.gy/u/daniyalSelani)\
**Post date:** [June 30, 2020, 10:59am UTC](https://support.prodi.gy/t/trouble-with-blocks-annotation-api/3114/1 "2020-06-30T10:59:27Z")

</div>

Im trying to use the new\_manual and choice interfaces together using the blocks interface. The specific code is as follows:

```
    result = {
    'view_id': 'ner_manual', # Annotation interface to use
    'view_id': 'blocks', # Annotation interface to use
    'dataset': dataset, # ID of the current project. Used to associate the annotation with a project in the database.
    'stream': stream, # Stream of annotation tasks in Prodigy's JSON format
    'exclude': exclude, # List of dataset IDs whose annotations to exclude.
    'config': { # Additional config settings, mostly for app UI
        'lang': 'en',
        'blocks' : [
            {'view_id': 'ner_manual'}, 
             {'view_id': 'html', 'html_template' : template_text },
             {'view_id': 'choice'}, # Annotation interface to use
             {'view_id': 'html', 'html_template': '<h4 style="text-align:left;color:#583fcf;">Type your comments here (optional):</h4>'},
             {"view_id": "text_input", "field_rows": 3},
        ]}

```

However, all the labels are displayed at the start of the document as such:  
_[image removed]_  
The labels should not be aggregated at the start of the document like that.

At first i thought it was an issue with my input file, or the preprocessing done on the input stream. However when i comment out this specific line:

`'view\_id': 'ner\_manual', # Annotation interface to use

The UI gets magically fixed, of course now i cannot perform manual ner tagging on the documents

_[image removed]_

What do you think is the issue

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [June 30, 2020, 11:31am UTC](https://support.prodi.gy/t/trouble-with-blocks-annotation-api/3114/2 "2020-06-30T11:31:04Z")

</div>

Can you show an example of the data you're loading in? And did you double-check that it has `"tokens"` and the correct token references set if you're loading in pre-defined spans? This should be taken care of automatically if you use Prodigy's `add_tokens` preprocessor.

I think what might be happening here is this:

- _Something_ prevents the `ner_manual` UI block from rendering your existing spans correctly (e.g. because they don't specify the tokens they belong to).
- If you remove the `ner_manual` block from your blocks, your `"text"` and `"spans"` will be rendered by the `choice` block – because that can also show a top-level text, and if there are `"spans"`, it will highlight the spans. That's often useful if you're only using a `choice` block. But the `choice` block will just show the static text with entities – and that doesn't need any tokens, just the character offsets, because nothing is editable. So the spans display fine here.
