Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IT DateTimeV2] Fix for time expression [minutes] minuti alle [hour] #3067

Merged
merged 21 commits into from
Mar 3, 2023

Conversation

andrew-gradinari
Copy link
Contributor

Fix for Italian time expressions such as "5 minuti alle quattro".

References: Time in Italian

tellarin and others added 20 commits March 25, 2022 16:35
…n for Units (microsoft#2877) (microsoft#2879)

- Support informal degrees in PT and ES (microsoft#2877);

- Fix issue in generation of Spanish unit resources;

- Re-generate all resources across platforms.
…icrosoft#2878)

* Enabling SpanishMexican culture in Number/Unit/DateTimveV2

* Update Spanish number specs according to review

Co-authored-by: Colm Dillon <[email protected]>
* Add Portuguese DateTime support in Python

* Update Specs with Python changes

* Fix Number import issue

* Update specs according to build and review

* Remove empty NotSupported fields from specs
…eTimeRanges (microsoft#2894)

* Workaround for TimexProperty.ToString() to not crash on DateTimeRanges 

* Add TODO for fixing the TimexProperty date range representation properly according to review
Fetch microsoft/Recognizers-Text upstream changes
[NLU-2858] Fetch upstream changes from microsoft:master -> purecloudlabs:master
Merge MS Recognizers into master
Bringing Pureclould Labs master up to-date with Microsoft master
Update fork with MS recognizers latest
@andrew-gradinari
Copy link
Contributor Author

Hello @tellarin, could you please take a look at this pull request as well as #3061, #3063, #3065, and #3066? Thank you in advance.

@tellarin
Copy link
Collaborator

tellarin commented Feb 9, 2023

@andrew-gradinari Thanks for the ping. We'll review them shortly.

Copy link
Collaborator

@tellarin tellarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a couple examples of the new behaviour at the model level (DateTimeModel.json) too? This is critical to show the final output is correct.
Also, it would be good if you can add other examples using "e|meno" in other scenarios to show no behaviour there was broken with the change. If such examples already exist, please mention it in the PR description.

@andrew-gradinari
Copy link
Contributor Author

@tellarin There are some examples using "e|meno":

TimeExtractor.json

"Input": "Sono le otto e mezza",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "otto e mezza",
"Type": "time",
"Start": 8,
"Length": 12
}
]
},
{
"Input": "Sono le 8 e mezza pm",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "8 e mezza pm",
"Type": "time",
"Start": 8,
"Length": 12
}
]
},
{
"Input": "Sono le otto e 30 min",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "otto e 30 min",
"Type": "time",
"Start": 8,
"Length": 13
}
]
},
{
"Input": "Sono le otto e un quarto",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "otto e un quarto",
"Type": "time",
"Start": 8,
"Length": 16
}
]
},
{
"Input": "Sono le 9pm e tre quarti",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "9pm e tre quarti",
"Type": "time",
"Start": 8,
"Length": 16
}
]
},
{
"Input": "Sono le otto meno tre minuti",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "otto meno tre minuti",
"Type": "time",
"Start": 8,
"Length": 20
}
]
},
{
"Input": "Sono le sette e mezza",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "sette e mezza",
"Type": "time",
"Start": 8,
"Length": 13
}
]
},
{
"Input": "Sono le sette e mezza di pomeriggio",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "sette e mezza di pomeriggio",
"Type": "time",
"Start": 8,
"Length": 27
}
]
},
{
"Input": "Sono le sette e mezza del mattino",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "sette e mezza del mattino",
"Type": "time",
"Start": 8,
"Length": 25
}
]
},
{
"Input": "Sono le 8 meno un quarto del mattino",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "8 meno un quarto del mattino",
"Type": "time",
"Start": 8,
"Length": 28
}
]
},
{
"Input": "Sono le otto e un quarto di sera",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "otto e un quarto di sera",
"Type": "time",
"Start": 8,
"Length": 24
}
]

TimeParser.json

"Input": "Sono le otto e mezza",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "otto e mezza",
"Type": "time",
"Value": {
"Timex": "T08:30",
"FutureResolution": {
"time": "08:30:00"
},
"PastResolution": {
"time": "08:30:00"
}
},
"Start": 8,
"Length": 12
}
]
},
{
"Input": "Sono le 8 e mezza pm",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "8 e mezza pm",
"Type": "time",
"Value": {
"Timex": "T20:30",
"FutureResolution": {
"time": "20:30:00"
},
"PastResolution": {
"time": "20:30:00"
}
},
"Start": 8,
"Length": 12
}
]
},
{
"Input": "Sono le otto e 30 min",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "otto e 30 min",
"Type": "time",
"Value": {
"Timex": "T08:30",
"FutureResolution": {
"time": "08:30:00"
},
"PastResolution": {
"time": "08:30:00"
}
},
"Start": 8,
"Length": 13
}
]
},
{
"Input": "Sono le otto e un quarto",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "otto e un quarto",
"Type": "time",
"Value": {
"Timex": "T08:15",
"FutureResolution": {
"time": "08:15:00"
},
"PastResolution": {
"time": "08:15:00"
}
},
"Start": 8,
"Length": 16
}
]
},
{
"Input": "Sono le 9pm e tre quarti",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "9pm e tre quarti",
"Type": "time",
"Value": {
"Timex": "T21:45",
"FutureResolution": {
"time": "21:45:00"
},
"PastResolution": {
"time": "21:45:00"
}
},
"Start": 8,
"Length": 16
}
]
},
{
"Input": "Sono le otto meno tre minuti",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "otto meno tre minuti",
"Type": "time",
"Value": {
"Timex": "T07:57",
"FutureResolution": {
"time": "07:57:00"
},
"PastResolution": {
"time": "07:57:00"
}
},
"Start": 8,
"Length": 20
}
]
},
{
"Input": "Sono le sette e mezza",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "sette e mezza",
"Type": "time",
"Value": {
"Timex": "T07:30",
"FutureResolution": {
"time": "07:30:00"
},
"PastResolution": {
"time": "07:30:00"
}
},
"Start": 8,
"Length": 13
}
]
},
{
"Input": "Sono le sette e mezza di pomeriggio",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "sette e mezza di pomeriggio",
"Type": "time",
"Value": {
"Timex": "T19:30",
"FutureResolution": {
"time": "19:30:00"
},
"PastResolution": {
"time": "19:30:00"
}
},
"Start": 8,
"Length": 27
}
]
},
{
"Input": "Sono le sette e mezza del mattino",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "sette e mezza del mattino",
"Type": "time",
"Value": {
"Timex": "T07:30",
"FutureResolution": {
"time": "07:30:00"
},
"PastResolution": {
"time": "07:30:00"
}
},
"Start": 8,
"Length": 25
}
]
},
{
"Input": "Sono le 8 meno un quarto del mattino",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "8 meno un quarto del mattino",
"Type": "time",
"Value": {
"Timex": "T07:45",
"FutureResolution": {
"time": "07:45:00"
},
"PastResolution": {
"time": "07:45:00"
}
},
"Start": 8,
"Length": 28
}
]
},
{
"Input": "Sono le otto e 20 min di sera",
"NotSupportedByDesign": "javascript",
"Results": [
{
"Text": "otto e 20 min di sera",
"Type": "time",
"Value": {
"Timex": "T20:20",
"FutureResolution": {
"time": "20:20:00"
},
"PastResolution": {
"time": "20:20:00"
}
},
"Start": 8,
"Length": 21
}
]
},

DateTimeModel.json

"Input": "Sono le sette e mezza",
"Context": {
"ReferenceDateTime": "2016-11-07T00:00:00"
},
"NotSupportedByDesign": "javascript,java",
"Results": [
{
"Text": "sette e mezza",
"TypeName": "datetimeV2.time",
"Resolution": {
"values": [
{
"timex": "T07:30",
"type": "time",
"value": "07:30:00"
},
{
"timex": "T19:30",
"type": "time",
"value": "19:30:00"
}
]
},
"Start": 8,
"End": 20
}
]
},
{
"Input": "Sone le otto e 20 di sera",
"Context": {
"ReferenceDateTime": "2016-11-07T00:00:00"
},
"NotSupportedByDesign": "javascript,java",
"Results": [
{
"Text": "otto e 20 di sera",
"TypeName": "datetimeV2.time",
"Resolution": {
"values": [
{
"timex": "T20:20",
"type": "time",
"value": "20:20:00"
}
]
},
"Start": 8,
"End": 24
}
]
},

Anyway, I have added a few more examples to DateTimeModel.json. I would appreciate it if you could take a look.

@tellarin tellarin merged commit ced7af4 into microsoft:master Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants