Supported builtin entities¶
Builtin entities are entities that have
a built-in support in Snips NLU. These entities are associated to specific
builtin entity parsers which provide an extra resolution step. Typically,
dates written in natural language ("in three days"
) are resolved into ISO
formatted dates ("2019-08-12 00:00:00 +02:00"
).
Here is the list of supported builtin entities:
Entity | Identifier | Category | Supported Languages |
---|---|---|---|
AmountOfMoney | snips/amountOfMoney | Grammar Entity | de, en, es, fr, it, ja, ko, pt_br, pt_pt |
Duration | snips/duration | Grammar Entity | de, en, es, fr, it, ja, ko, pt_br, pt_pt |
Number | snips/number | Grammar Entity | de, en, es, fr, it, ja, ko, pt_br, pt_pt |
Ordinal | snips/ordinal | Grammar Entity | de, en, es, fr, it, ja, ko, pt_br, pt_pt |
Temperature | snips/temperature | Grammar Entity | de, en, es, fr, it, ja, ko, pt_br, pt_pt |
Datetime | snips/datetime | Grammar Entity | de, en, es, fr, it, ja, ko, pt_br, pt_pt |
Date | snips/date | Grammar Entity | en |
Time | snips/time | Grammar Entity | en |
DatePeriod | snips/datePeriod | Grammar Entity | en |
TimePeriod | snips/timePeriod | Grammar Entity | en |
Percentage | snips/percentage | Grammar Entity | de, en, es, fr, it, ja, pt_br, pt_pt |
MusicAlbum | snips/musicAlbum | Gazetteer Entity | de, en, es, fr, it, ja, pt_br, pt_pt |
MusicArtist | snips/musicArtist | Gazetteer Entity | de, en, es, fr, it, ja, pt_br, pt_pt |
MusicTrack | snips/musicTrack | Gazetteer Entity | de, en, es, fr, it, ja, pt_br, pt_pt |
City | snips/city | Gazetteer Entity | de, en, es, fr, it, ja, pt_br, pt_pt |
Country | snips/country | Gazetteer Entity | de, en, es, fr, it, ja, pt_br, pt_pt |
Region | snips/region | Gazetteer Entity | de, en, es, fr, it, ja, pt_br, pt_pt |
The entity identifier (second column above) is what is used in the dataset to reference a builtin entity.
Grammar Entity¶
Grammar entities, in the context of Snips NLU, correspond to entities which contain significant compositionality. The semantic meaning of such an entity is determined by the meanings of its constituent expressions and the rules used to combine them. Modern semantic parsers for these entities are often based on defining a formal grammar. In the case of Snips NLU, the parser used to handle these entities is Rustling, a Rust adaptation of Facebook’s duckling.
Gazetteer Entity¶
Gazetteer entities correspond to all the builtin entities which do not contain any semantic structure, as opposed to the grammar entities. For such entities, a gazetteer entity parser is used to perform the parsing.
Results Examples¶
The following sections provide examples for each builtin entity.
AmountOfMoney¶
Input examples:
[
"$10",
"six euros",
"around 5€",
"ten dollars and five cents"
]
Output examples:
[
{
"kind": "AmountOfMoney",
"value": 10.05,
"precision": "Approximate",
"unit": "€"
}
]
Duration¶
Input examples:
[
"1h",
"during two minutes",
"for 20 seconds",
"3 months",
"half an hour",
"8 years and two days"
]
Output examples:
[
{
"kind": "Duration",
"years": 0,
"quarters": 0,
"months": 3,
"weeks": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0,
"precision": "Exact"
}
]
Number¶
Input examples:
[
"2001",
"twenty one",
"three hundred and four"
]
Output examples:
[
{
"kind": "Number",
"value": 42.0
}
]
Ordinal¶
Input examples:
[
"1st",
"the second",
"the twenty third"
]
Output examples:
[
{
"kind": "Ordinal",
"value": 2
}
]
Temperature¶
Input examples:
[
"70K",
"3°C",
"Twenty three degrees",
"one hundred degrees fahrenheit"
]
Output examples:
[
{
"kind": "Temperature",
"value": 23.0,
"unit": "celsius"
},
{
"kind": "Temperature",
"value": 60.0,
"unit": "fahrenheit"
}
]
Datetime¶
Input examples:
[
"Today",
"at 8 a.m.",
"4:30 pm",
"in 1 hour",
"the 3rd tuesday of June"
]
Output examples:
[
{
"kind": "InstantTime",
"value": "2017-06-13 18:00:00 +02:00",
"grain": "Hour",
"precision": "Exact"
},
{
"kind": "TimeInterval",
"from": "2017-06-07 18:00:00 +02:00",
"to": "2017-06-08 00:00:00 +02:00"
}
]
Date¶
Input examples:
[
"today",
"on Wednesday",
"March 26th",
"saturday january 19",
"monday 15th april 2019",
"the day after tomorrow"
]
Output examples:
[
{
"kind": "InstantTime",
"value": "2017-06-13 00:00:00 +02:00",
"grain": "Day",
"precision": "Exact"
}
]
Time¶
Input examples:
[
"now",
"at noon",
"at 8 a.m.",
"4:30 pm",
"in one hour",
"for ten o'clock",
"at ten in the evening"
]
Output examples:
[
{
"kind": "InstantTime",
"value": "2017-06-13 18:00:00 +02:00",
"grain": "Hour",
"precision": "Exact"
}
]
DatePeriod¶
Input examples:
[
"january",
"2019",
"from monday to friday",
"from wednesday 27th to saturday 30th",
"this week"
]
Output examples:
[
{
"kind": "TimeInterval",
"from": "2017-06-07 00:00:00 +02:00",
"to": "2017-06-09 00:00:00 +02:00"
}
]
TimePeriod¶
Input examples:
[
"until dinner",
"from five to ten",
"by the end of the day"
]
Output examples:
[
{
"kind": "TimeInterval",
"from": "2017-06-07 18:00:00 +02:00",
"to": "2017-06-07 20:00:00 +02:00"
}
]
Percentage¶
Input examples:
[
"25%",
"twenty percent",
"two hundred and fifty percents"
]
Output examples:
[
{
"kind": "Percentage",
"value": 20.0
}
]
MusicAlbum¶
Input examples:
[
"Discovery"
]
Output examples:
[
{
"kind": "MusicAlbum",
"value": "Discovery"
}
]
MusicArtist¶
Input examples:
[
"Daft Punk"
]
Output examples:
[
{
"kind": "MusicArtist",
"value": "Daft Punk"
}
]
MusicTrack¶
Input examples:
[
"Harder Better Faster Stronger"
]
Output examples:
[
{
"kind": "MusicTrack",
"value": "Harder Better Faster Stronger"
}
]
City¶
Input examples:
[
"San Francisco",
"Los Angeles",
"Beijing",
"Paris"
]
Output examples:
[
{
"kind": "City",
"value": "Paris"
}
]
Region¶
Input examples:
[
"California",
"Washington"
]
Output examples:
[
{
"kind": "Region",
"value": "California"
}
]