# How can i determine the company role of each employee based on a paragraph of text?

**URL:** <https://support.prodi.gy/t/how-can-i-determine-the-company-role-of-each-employee-based-on-a-paragraph-of-text/2676>\
**Category:** Uncategorized\
**Tags:** usage\
**Created:** [March 18, 2020, 7:42pm UTC](https://support.prodi.gy/t/how-can-i-determine-the-company-role-of-each-employee-based-on-a-paragraph-of-text/2676 "2020-03-18T19:42:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yishairasowsky](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/yishairasowsky/32/1271_2.png) [@yishairasowsky](https://support.prodi.gy/u/yishairasowsky)\
**Post date:** [March 18, 2020, 7:42pm UTC](https://support.prodi.gy/t/how-can-i-determine-the-company-role-of-each-employee-based-on-a-paragraph-of-text/2676/1 "2020-03-18T19:42:24Z")

</div>

How can i determine the company role of each employee based on a paragraph of text?

I want to do this using machine learning.

I do not know necessarily what role titles will be given.

Example input:

```
"The CEO is John Smith; Jane Jones is the COO, and recently Mark Wright was made the CTO."

```

Desired output:

```
{"CEO": "John Smith", "COO":"Jane Jones", "CTO":"Mark Wright"}
```

---

<div class="post-metadata">

**Author:** ![yishairasowsky](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/yishairasowsky/32/1271_2.png) [@yishairasowsky](https://support.prodi.gy/u/yishairasowsky)\
**Post date:** [March 19, 2020, 6:36pm UTC](https://support.prodi.gy/t/how-can-i-determine-the-company-role-of-each-employee-based-on-a-paragraph-of-text/2676/2 "2020-03-19T18:36:40Z")

</div>

if i have thousands of paragraphs which indicate the titles in the staff of a team, e.g. "CEO is Smith, the CTO will be Jones, for ten years Higgins has been the VP", then how can I se machine to extract this information and classify it neatly?

---

<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:** [March 20, 2020, 8:22pm UTC](https://support.prodi.gy/t/how-can-i-determine-the-company-role-of-each-employee-based-on-a-paragraph-of-text/2676/3 "2020-03-20T20:22:33Z")

</div>

What works best ultimately depends on your data, but you could try and solve this with a combination of named entity recognition to first detect all names in the text, and then use rules based on the syntax and keywords ("CEO", "CTO" etc.) to extract the relationships.

This example shows a pretty similar use case:

> **[Rule-based matching · spaCy Usage Documentation](https://spacy.io/usage/rule-based-matching/)**
>
> Find phrases and tokens, and match entities

Also see the documentation on NER with Prodigy here:

> **[Named Entity Recognition · Prodigy · An annotation tool for AI, Machine...](https://prodi.gy/docs/named-entity-recognition/)**
>
> A downloadable annotation tool for NLP and computer vision tasks such as named entity recognition, text classification, object detection, image segmentation, A/B evaluation and more.
