# Entity Extraction for hostnames with punctuation's (\< - | \>)

**URL:** <https://forum.rasa.com/t/entity-extraction-for-hostnames-with-punctuations/15430>\
**Category:** Rasa Open Source\
**Created:** [September 9, 2019, 1:43pm UTC](https://forum.rasa.com/t/entity-extraction-for-hostnames-with-punctuations/15430 "2019-09-09T13:43:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vigneshp826](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/vigneshp826/32/657_2.png) [@vigneshp826](https://forum.rasa.com/u/vigneshp826)\
**Post date:** [September 9, 2019, 1:43pm UTC](https://forum.rasa.com/t/entity-extraction-for-hostnames-with-punctuations/15430/1 "2019-09-09T13:43:43Z")

</div>

HI @akelad @Ghostvv @erohmensing

The problem with SLACK platform is, it sends [hostname.net](http://hostname.net) input to slackclient as \<[http://hostname.net|hostname.net](http://hostname.net%7Chostname.net)\>.  
I would like to extract that \<[http://hostname.net|hostname.net](http://hostname.net%7Chostname.net)\> as `hostname` entity and later i will convert that into [hostname.net](http://hostname.net) in my actions.py. I have given the nlu.md with below data sets. Also below is my config.yml where am using CRFEntityExtractor to get entities.

But am getting misaligned entity error when running rasa interactive.

```auto
Misaligned entity annotation for 'http://abc.net abc.net' in sentence 'pls remove blackout for <http://abc.net|abc.net> please' with intent 'stop_blackout+host_or_db'. Make sure the start and end values of the annotated training examples end at token boundaries (e.g. don't include trailing whitespaces or punctuation).

```

Config.yml

```auto
policies:
  - name: MemoizationPolicy
  - name: KerasPolicy
  - name: MappingPolicy
  - name: FormPolicy

pipeline: 
- name: "WhitespaceTokenizer"
  case_sensitive: false
- name: "RegexFeaturizer"
- name: "CRFEntityExtractor"
- name: "ner_synonyms"
- name: "intent_featurizer_count_vectors"
  "stop_words": ['pls','lol','hmm','uggh','ok','then']
- name: "intent_classifier_tensorflow_embedding"
  intent_tokenization_flag: true
  intent_split_symbol: "+"
  path: "./models/"
  data: "./data/"
- name: "ner_duckling_http"
  url: "http://localhost:8081"
  locale: "en"
  dimensions: ["time", "duration","unit-of-duration"]

```

nlu.md

```auto
## intent:host_or_db

- blackout for [<http://hostname1.net|hostname1.net>](hostname)
- for [<http://hostname2.net|hostname2.net>](hostname)
- for [<http://hostname3.net|hostname3.net>](hostname)

```

Can you guys please give me some insight how i can solve this issue?

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [September 9, 2019, 2:09pm UTC](https://forum.rasa.com/t/entity-extraction-for-hostnames-with-punctuations/15430/2 "2019-09-09T14:09:31Z")

</div>

Seems like it would make more sense for this to be handled in the slack input channel. It is a similar problem from here: [Entity extraction problem due to Slack adding link](http://forum.rasa.com/t/entity-extraction-problem-due-to-slack-adding-link/3691/3)

I.e. in the slack input channel, it should look for a regex of e.g…

```auto
<http://{something}|{something}>

```

and turn it back to `{something}` before it gets to Rasa. There’s already a similar one in the input channel that strips the user tags from the input. Would you be interested in working on this problem and PRing a fix?

---

<div class="post-metadata">

**Author:** ![vigneshp826](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/vigneshp826/32/657_2.png) [@vigneshp826](https://forum.rasa.com/u/vigneshp826)\
**Post date:** [September 9, 2019, 3:27pm UTC](https://forum.rasa.com/t/entity-extraction-for-hostnames-with-punctuations/15430/3 "2019-09-09T15:27:25Z")

</div>

@erohmensing let me work on it. Will submit a PR once done

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [September 10, 2019, 9:02am UTC](https://forum.rasa.com/t/entity-extraction-for-hostnames-with-punctuations/15430/4 "2019-09-10T09:02:10Z")

</div>

awesome! can you claim this issue on github? [improve slack sanitization · Issue #4418 · RasaHQ/rasa · GitHub](https://github.com/RasaHQ/rasa/issues/4418)

---

<div class="post-metadata">

**Author:** ![vigneshp826](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/vigneshp826/32/657_2.png) [@vigneshp826](https://forum.rasa.com/u/vigneshp826)\
**Post date:** [September 17, 2019, 3:37pm UTC](https://forum.rasa.com/t/entity-extraction-for-hostnames-with-punctuations/15430/5 "2019-09-17T15:37:38Z")

</div>

@erohmensing here is the PR

> <https://github.com/RasaHQ/rasa/pull/4475>
>
> \*\*Proposed changes\*\*:
> \- Find mailto or http links like \<mailto:xyz@rasa.com|xyz…@rasa.com\> or '\<http://url.com|url.com\> in 
> text generated by slack and substitute it with original content
> \- fixes https://github.com/RasaHQ/rasa/issues/4418
> 
> \*\*Status (please check what you already did)\*\*:
> \- \[X\] made PR ready for code review
> \- \[\] added some tests for the functionality
> \- \[\] updated the documentation
> \- \[\] updated the changelog
> \- \[\] reformat files using \`black\` (please check \[Readme\](https://github.com/RasaHQ/rasa\_nlu#code-style) for instructions)
