Entity Mapper#
In this example, we will map the name of the Person
with either a Company
or City
using the english-entity
domain.
We will center the mapping around the Person
entity and attempt to find all relations with the concepts found in the given sentence. As such, we use Person
as the left hand side (lhs
), and for the right hand side (rhs
) we use Company
and City
. This results in the mappings: Person -> Company
and Person -> City
.
We also want the gender of the Person
so we need to format the gender field using a f-string format like Gender=Person.gender
Introduction#
entity_mapper -i "John Dow works for EyeOnText in Antwerp." --lhs "Person" --rhs "Company,City" -p english,entity --fields "Person,City,Company,Gender=Person.gender"
[
{"id": "stream_id_111203124502395056", "Person": "John Dow", "Company": "EyeOnText", "Gender": "male"},
{"id": "stream_id_111203124502395056", "Person": "John Dow", "City": "Antwerp", "Gender": "male"}
]
You can add the -o test.csv
option to save it to a CSV file.
Options#
See all the options: EntityMapper API