# Problem with creating a new entity in swedish

**URL:** <https://support.prodi.gy/t/problem-with-creating-a-new-entity-in-swedish/985>\
**Category:** Uncategorized\
**Tags:** usage, ner\
**Created:** [November 23, 2018, 12:29pm UTC](https://support.prodi.gy/t/problem-with-creating-a-new-entity-in-swedish/985 "2018-11-23T12:29:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikael](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/mikael/32/809_2.png) [@mikael](https://support.prodi.gy/u/mikael)\
**Post date:** [November 23, 2018, 12:29pm UTC](https://support.prodi.gy/t/problem-with-creating-a-new-entity-in-swedish/985/1 "2018-11-23T12:29:37Z")

</div>

Im trying to create a new entity for broadband related products and started out with creating a pattern file.  
The problem occurs at the end when trying to run the new model on new or existing phrases. It identifies all words in the sentence as label product. I start with a complete new empty model.

Step 1. Create the pattern file and save it to service\_pattern.jsonl

```
{"label":"product","pattern":[{"lower":"telefoni"}]}
{"label":"product","pattern":[{"lower":"telefoni"}]}
{"label":"product","pattern":[{"lower":"bredband"}]}
{"label":"product","pattern":[{"lower":"bredbandsabonnemang"}]}
{"label":"product","pattern":[{"lower":"bredbandsanslutning"}]}
{"label":"product","pattern":[{"lower":"internet"}]}

```

Step 2 :I import a file with suitable phrases and start the annotation tool. In this case I use a file with 50 sentences but I have been using a file with thousands of rows with the same result.

```
prodigy ner.teach ner_swedish_products sv-model service-phrases.txt
--patterns service_pattern.jsonl

```

Step 3: batch-train and output to a new model

```
  prodigy ner.batch-train ner_swedish_products sv-model 
  --output product_bootstrap_model

```

Step 4: The training performs well with accuracy of 1.0

`Accuracy 1.000`

Problem: The problem comes when I try to use the new model as input when i ner.teach on new phrases.  
Prodigy identifies all words inside the phrase as products.

Even when Im using the service-phrases.txt above it missmatch.

What am I doing wrong?

---

<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:** [November 24, 2018, 12:17pm UTC](https://support.prodi.gy/t/problem-with-creating-a-new-entity-in-swedish/985/2 "2018-11-24T12:17:45Z")

</div>

Yes, an accuracy of `1.0` is always suspicious! Your workflow sounds alright – could you post the full results after training that includes all statistics?

---

<div class="post-metadata">

**Author:** ![mikael](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/mikael/32/809_2.png) [@mikael](https://support.prodi.gy/u/mikael)\
**Post date:** [November 26, 2018, 9:53am UTC](https://support.prodi.gy/t/problem-with-creating-a-new-entity-in-swedish/985/3 "2018-11-26T09:53:09Z")

</div>

I cant reproduce the scenario with the same 1.0 accuracy but I started over with a new dataset and fresh model. The result is the same but with lower accuracy. I also added a new batch of training after the first round but it makes no difference.

1. Created a new dataset with name ner\_product and start annotating with the same patterns file.

2. Result of the fist training round

3. Annotating the new model with other phrases

4. Run batch training again from empty model

It is almost the same result if i use a few examples or if i use thousands of them.

When I evaluate the model the model still thinks that punctuation, words like “jag(I), och (and), eller(or)” and so on are products.

---

<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:** [November 26, 2018, 11:20am UTC](https://support.prodi.gy/t/problem-with-creating-a-new-entity-in-swedish/985/4 "2018-11-26T11:20:33Z")

</div>

Do you have any full results and/or examples you can share from when you used larger dataset with thousands of examples? The problem here is that it’s super difficult to draw any conclusions from the results, because you’re only training from 24 examples. Even if the result is similar to the result you see if you train with thousands of examples, it might be for completely different reasons.
