mirror of
https://github.com/facebook/duckling.git
synced 2025-01-06 04:53:13 +03:00
added new rule to handle ES phrase for next week (#497)
Summary: Current: "siquiente semana" -> [] // empty result Expected: "siquiete semana" -> "next week" Pull Request resolved: https://github.com/facebook/duckling/pull/497 Test Plan: haxlsh> H.io $ debug (makeLocale ES Nothing) "siguiente semana" [This Time] Reviewed By: chinmay87 Differential Revision: D22054455 Pulled By: yuanbing fbshipit-source-id: 576e96a49eebace9b5baa382efac2e266e651d8e
This commit is contained in:
parent
44007b76d3
commit
c7aed76c5a
@ -197,8 +197,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("semana (grain)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.890371757896165,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 16},
|
||||
ClassData{prior = 0.0, unseen = -3.0910424533583156,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 20},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -1228,6 +1228,22 @@ classifiers
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("next week (alt)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.3364722366212129,
|
||||
unseen = -2.5649493574615367,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 5},
|
||||
koData =
|
||||
ClassData{prior = -1.252762968495368, unseen = -1.9459101490553135,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 2}}),
|
||||
("Marzo",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.3025850929940455,
|
||||
|
@ -197,8 +197,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("semana (grain)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.890371757896165,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 16},
|
||||
ClassData{prior = 0.0, unseen = -3.0910424533583156,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 20},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -1228,6 +1228,22 @@ classifiers
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("next week (alt)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.3364722366212129,
|
||||
unseen = -2.5649493574615367,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 5},
|
||||
koData =
|
||||
ClassData{prior = -1.252762968495368, unseen = -1.9459101490553135,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 2}}),
|
||||
("Marzo",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.3025850929940455,
|
||||
|
@ -197,8 +197,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("semana (grain)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.890371757896165,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 16},
|
||||
ClassData{prior = 0.0, unseen = -3.0910424533583156,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 20},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -1228,6 +1228,22 @@ classifiers
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("next week (alt)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.3364722366212129,
|
||||
unseen = -2.5649493574615367,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 5},
|
||||
koData =
|
||||
ClassData{prior = -1.252762968495368, unseen = -1.9459101490553135,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 2}}),
|
||||
("Marzo",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.3025850929940455,
|
||||
|
@ -197,8 +197,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("semana (grain)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.890371757896165,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 16},
|
||||
ClassData{prior = 0.0, unseen = -3.0910424533583156,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 20},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -1228,6 +1228,22 @@ classifiers
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("next week (alt)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.3364722366212129,
|
||||
unseen = -2.5649493574615367,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 5},
|
||||
koData =
|
||||
ClassData{prior = -1.252762968495368, unseen = -1.9459101490553135,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 2}}),
|
||||
("Marzo",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.3025850929940455,
|
||||
|
@ -197,8 +197,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("semana (grain)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.890371757896165,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 16},
|
||||
ClassData{prior = 0.0, unseen = -3.0910424533583156,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 20},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -1228,6 +1228,22 @@ classifiers
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("next week (alt)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.3364722366212129,
|
||||
unseen = -2.5649493574615367,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 5},
|
||||
koData =
|
||||
ClassData{prior = -1.252762968495368, unseen = -1.9459101490553135,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 2}}),
|
||||
("Marzo",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.3025850929940455,
|
||||
|
@ -197,8 +197,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("semana (grain)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.890371757896165,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 16},
|
||||
ClassData{prior = 0.0, unseen = -3.0910424533583156,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 20},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -1228,6 +1228,22 @@ classifiers
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("next week (alt)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.3364722366212129,
|
||||
unseen = -2.5649493574615367,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 5},
|
||||
koData =
|
||||
ClassData{prior = -1.252762968495368, unseen = -1.9459101490553135,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 2}}),
|
||||
("Marzo",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.3025850929940455,
|
||||
|
@ -197,8 +197,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("semana (grain)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.890371757896165,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 16},
|
||||
ClassData{prior = 0.0, unseen = -3.0910424533583156,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 20},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -1228,6 +1228,22 @@ classifiers
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("next week (alt)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.3364722366212129,
|
||||
unseen = -2.5649493574615367,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 5},
|
||||
koData =
|
||||
ClassData{prior = -1.252762968495368, unseen = -1.9459101490553135,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 2}}),
|
||||
("Marzo",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.3025850929940455,
|
||||
|
@ -197,8 +197,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("semana (grain)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.890371757896165,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 16},
|
||||
ClassData{prior = 0.0, unseen = -3.0910424533583156,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 20},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -1228,6 +1228,22 @@ classifiers
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("next week (alt)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.3364722366212129,
|
||||
unseen = -2.5649493574615367,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 5},
|
||||
koData =
|
||||
ClassData{prior = -1.252762968495368, unseen = -1.9459101490553135,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("week", -0.6931471805599453),
|
||||
("semana (grain)", -0.6931471805599453)],
|
||||
n = 2}}),
|
||||
("Marzo",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.3025850929940455,
|
||||
|
@ -175,6 +175,10 @@ allExamples = concat
|
||||
[ "la semana que viene"
|
||||
, "la proxima semana"
|
||||
, "semana que viene"
|
||||
, "proxima semana"
|
||||
, "proximas semana"
|
||||
, "próxima semana"
|
||||
, "siguiente semana"
|
||||
]
|
||||
, examples (datetime (2013, 1, 1, 0, 0, 0) Month)
|
||||
[ "el pasado mes"
|
||||
|
@ -1519,6 +1519,18 @@ ruleElDayofmonthNonOrdinalWithDia = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleNextWeekAlt :: Rule
|
||||
ruleNextWeekAlt = Rule
|
||||
{
|
||||
name = "next week (alt)"
|
||||
, pattern =
|
||||
[
|
||||
regex "pr(ó|o)xim(o|a)s?|siguientes?"
|
||||
, Predicate $ isGrain TG.Week
|
||||
]
|
||||
, prod = \_ -> tt $ cycleNth TG.Week 1
|
||||
}
|
||||
|
||||
rules :: [Rule]
|
||||
rules =
|
||||
[ ruleALasHourmintimeofday
|
||||
@ -1613,6 +1625,7 @@ rules =
|
||||
, ruleTimezone
|
||||
, ruleElDayofmonthNonOrdinalWithDia
|
||||
, ruleNextWeek
|
||||
, ruleNextWeekAlt
|
||||
]
|
||||
++ ruleDaysOfWeek
|
||||
++ ruleMonths
|
||||
|
Loading…
Reference in New Issue
Block a user