mirror of
https://github.com/facebook/duckling.git
synced 2024-09-11 21:27:13 +03:00
Added new rule for "midday" (#490)
Summary: added new EN rule to parse the phrases that contain "midday". Pull Request resolved: https://github.com/facebook/duckling/pull/490 Differential Revision: D21959562 Pulled By: chinmay87 fbshipit-source-id: f9ab45aecd551e8959d00b0025ed38b616ed6b14
This commit is contained in:
parent
596bf62888
commit
33aa18dca8
@ -3891,6 +3891,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -3891,6 +3891,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -4037,6 +4037,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -3971,6 +3971,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -3891,6 +3891,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -3891,6 +3891,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -3891,6 +3891,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -3891,6 +3891,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -3891,6 +3891,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -3891,6 +3891,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -4259,6 +4259,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -3952,6 +3952,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -3891,6 +3891,13 @@ classifiers
|
||||
[("hh:mm:ssintersect", -0.916290731874155),
|
||||
("secondsecond", -0.916290731874155)],
|
||||
n = 1}}),
|
||||
("Mid-day",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 3},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.1354942159291497,
|
||||
|
@ -1290,6 +1290,9 @@ allExamples = concat
|
||||
, examples (datetime (2013, 2, 12, 12, 0, 0) Hour)
|
||||
[ "at 12pm"
|
||||
, "at noon"
|
||||
, "midday"
|
||||
, "the midday"
|
||||
, "mid day"
|
||||
]
|
||||
, examples (datetime (2013, 2, 13, 0, 0, 0) Hour)
|
||||
[ "at 12am"
|
||||
|
@ -2473,6 +2473,15 @@ ruleIntervalDashTimezone = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleMidDay :: Rule
|
||||
ruleMidDay = Rule
|
||||
{ name = "Mid-day"
|
||||
, pattern =
|
||||
[ regex "(the )?mid(\\s)?day"
|
||||
]
|
||||
, prod = \_ -> tt $ hour False 12
|
||||
}
|
||||
|
||||
rules :: [Rule]
|
||||
rules =
|
||||
[ ruleIntersect
|
||||
@ -2606,6 +2615,7 @@ rules =
|
||||
, ruleBeginningOfYear
|
||||
, ruleClosest
|
||||
, ruleNthClosest
|
||||
, ruleMidDay
|
||||
]
|
||||
++ ruleInstants
|
||||
++ ruleDaysOfWeek
|
||||
|
Loading…
Reference in New Issue
Block a user