# How to auto accept answers based on meta data?

**URL:** https://support.prodi.gy/t/how-to-auto-accept-answers-based-on-meta-data/6783
**Category:** Uncategorized
**Tags:** usage, ner
**Created:** [September 12, 2023, 1:42pm UTC](https://support.prodi.gy/t/how-to-auto-accept-answers-based-on-meta-data/6783 "2023-09-12T13:42:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lazerlightning](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/lazerlightning/32/3822_2.png) [@lazerlightning](https://support.prodi.gy/u/lazerlightning)
#### Post date: [September 12, 2023, 1:42pm UTC](https://support.prodi.gy/t/how-to-auto-accept-answers-based-on-meta-data/6783/1 "2023-09-12T13:42:52Z")

</div>

New to ML! (Self-learning)

I have existing data which I am trying to get into a model.

Steps:

- Create CSV with text inputs and then the outputs I know are correct.
- Convert to jsonl and add the correct answers as meta data and annotations
- Run the ner.manual
  - Hit accept on each line (I dont need to check as ive added the annotations already)

- Run the ner.teach
  - Accept or Reject depending on the result in the meta data

How do I run the ner.manual and automatically accept all the data?  
How do I run the ner.teach and accept or reject if the match is same as meta data?

Ive looked at a custom recipe, however I cant find where I can accept or reject via code

Any help appreciated! 🙂

---

<div class="post-metadata">

### Author: ![ryanwesslen](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ryanwesslen/32/2969_2.png) [@ryanwesslen](https://support.prodi.gy/u/ryanwesslen)
#### Post date: [September 19, 2023, 9:01pm UTC](https://support.prodi.gy/t/how-to-auto-accept-answers-based-on-meta-data/6783/2 "2023-09-19T21:01:16Z")

</div>

hi @lazerlightning,

Thanks for your message and sorry for the delay -- most of the team was offsite last week and catching up.

I'm a bit curious to learn more about your use case.

At first glance, maybe I'm missing something -- if you have some unlabeled data that you want to "auto accept" based on metadata, why don't you simply remove those records from your source (input) so you're only labeling those records that you want to annotate?

> [@lazerlightning](#):
>
> How do I run the ner.manual and automatically accept all the data?

For these examples, where do the spans come from? Are you simply just accepting and not expecting any spans?

For example, if you were to label in `ner.manual` the sentence: `"Uber’s Lesson: Silicon Valley’s Start-Up Machine Needs Fixing"` where the only span is `Uber` as an `ORG`, then the data would be:

```python
{
  "text": "Uber’s Lesson: Silicon Valley’s Start-Up Machine Needs Fixing",
  "meta": {
    "source": "The New York Times"
  },
  "_input_hash": 1886699658,
  "_task_hash": -1952856502,
  "_is_binary": false,
  "tokens": [
    {
      "text": "Uber",
      "start": 0,
      "end": 4,
      "id": 0,
      "ws": false
    },
    {
      "text": "’s",
      "start": 4,
      "end": 6,
      "id": 1,
      "ws": true
    },
    {
      "text": "Lesson",
      "start": 7,
      "end": 13,
      "id": 2,
      "ws": false
    },
    {
      "text": ":",
      "start": 13,
      "end": 14,
      "id": 3,
      "ws": true
    },
    {
      "text": "Silicon",
      "start": 15,
      "end": 22,
      "id": 4,
      "ws": true
    },
    {
      "text": "Valley",
      "start": 23,
      "end": 29,
      "id": 5,
      "ws": false
    },
    {
      "text": "’s",
      "start": 29,
      "end": 31,
      "id": 6,
      "ws": true
    },
    {
      "text": "Start",
      "start": 32,
      "end": 37,
      "id": 7,
      "ws": false
    },
    {
      "text": "-",
      "start": 37,
      "end": 38,
      "id": 8,
      "ws": false
    },
    {
      "text": "Up",
      "start": 38,
      "end": 40,
      "id": 9,
      "ws": true
    },
    {
      "text": "Machine",
      "start": 41,
      "end": 48,
      "id": 10,
      "ws": true
    },
    {
      "text": "Needs",
      "start": 49,
      "end": 54,
      "id": 11,
      "ws": true
    },
    {
      "text": "Fixing",
      "start": 55,
      "end": 61,
      "id": 12,
      "ws": false
    }
  ],
  "_view_id": "ner_manual",
  "spans": [
    {
      "start": 0,
      "end": 4,
      "token_start": 0,
      "token_end": 0,
      "label": "ORG"
    }
  ],
  "answer": "accept",
  "_timestamp": 1690324597,
  "_annotator_id": "ner_dataset-ryan",
  "_session_id": "ner_dataset-ryan"
}

```

Notice how it includes the `"answer": "accept"` but also includes lots of other data like the tokens (see [`add_tokens`](https://prodi.gy/docs/api-components#add_tokens)) as well as the [hashes](https://prodi.gy/docs/api-loaders#hashing), timestamp, annotator\_id, and session\_id.

A few other questions so maybe it's just terminology:

> [@lazerlightning](#):
>
> Convert to jsonl and add the correct answers as meta data and annotations

What do you mean by "the correct answers"? Is an answer a correct annotation span?

> [@lazerlightning](#):
>
> How do I run the ner.teach and accept or reject if the match is same as meta data?

Can you clarify this a bit more?

Thanks for your help in clarifying!
