mirror of
https://github.com/facebook/duckling.git
synced 2024-11-29 01:03:44 +03:00
Added ruleIntervalDDDDMonth to EN
Summary: Added ruleIntervalDDDDMonth to EN to handle cases such as "23rd to 26th Oct" and "1-8 september" Reviewed By: patapizza Differential Revision: D5637280 fbshipit-source-id: a1fdcd2
This commit is contained in:
parent
5cad4359e2
commit
da41db3766
@ -23,7 +23,7 @@ classifiers
|
||||
= HashMap.fromList
|
||||
[("<integer> to|till|before <hour-of-day>",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -1.9459101490553135, unseen = -1.791759469228055,
|
||||
ClassData{prior = -2.0794415416798357, unseen = -1.791759469228055,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("integer (numeric)noon|midnight|EOD|end of day",
|
||||
@ -31,13 +31,13 @@ classifiers
|
||||
("hour", -0.916290731874155)],
|
||||
n = 1},
|
||||
koData =
|
||||
ClassData{prior = -0.15415067982725836,
|
||||
unseen = -2.772588722239781,
|
||||
ClassData{prior = -0.13353139262452263,
|
||||
unseen = -2.890371757896165,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("hour", -0.7621400520468967),
|
||||
("integer (numeric)time-of-day (latent)", -0.7621400520468967)],
|
||||
n = 6}}),
|
||||
[("hour", -0.7537718023763802),
|
||||
("integer (numeric)time-of-day (latent)", -0.7537718023763802)],
|
||||
n = 7}}),
|
||||
("<time> timezone",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.4849066497880004,
|
||||
@ -60,11 +60,12 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("integer (numeric)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.7820946665764414, unseen = -5.159055299214529,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 172},
|
||||
ClassData{prior = -0.7801585575495751, unseen = -5.181783550292085,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 176},
|
||||
koData =
|
||||
ClassData{prior = -0.6114691495456782, unseen = -5.327876168789581,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 204}}),
|
||||
ClassData{prior = -0.6131044728864089,
|
||||
unseen = -5.3471075307174685,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 208}}),
|
||||
("<duration> hence|ago",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.784189633918261,
|
||||
@ -160,25 +161,28 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("<day-of-month> (ordinal or number) <named-month>",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.9808292530117262, unseen = -2.70805020110221,
|
||||
ClassData{prior = -1.3862943611198906, unseen = -2.890371757896165,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("ordinal (digits)December", -1.9459101490553135),
|
||||
("ordinal (digits)February", -1.9459101490553135),
|
||||
("integer (numeric)April", -1.9459101490553135),
|
||||
("month", -1.252762968495368)],
|
||||
[("ordinal (digits)December", -2.1400661634962708),
|
||||
("ordinal (digits)February", -2.1400661634962708),
|
||||
("integer (numeric)April", -2.1400661634962708),
|
||||
("month", -1.4469189829363254)],
|
||||
n = 3},
|
||||
koData =
|
||||
ClassData{prior = -0.4700036292457356,
|
||||
unseen = -2.9444389791664407,
|
||||
ClassData{prior = -0.2876820724517809,
|
||||
unseen = -3.4011973816621555,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("ordinal (digits)July", -2.1972245773362196),
|
||||
("integer (numeric)August", -2.1972245773362196),
|
||||
("ordinal (digits)April", -2.1972245773362196),
|
||||
("month", -1.0986122886681098),
|
||||
("integer (numeric)July", -1.791759469228055)],
|
||||
n = 5}}),
|
||||
[("ordinal (digits)October", -2.6741486494265287),
|
||||
("ordinal (digits)July", -2.6741486494265287),
|
||||
("integer (numeric)September", -2.268683541318364),
|
||||
("ordinal (digits)August", -2.6741486494265287),
|
||||
("integer (numeric)August", -2.6741486494265287),
|
||||
("ordinal (digits)April", -2.6741486494265287),
|
||||
("month", -1.0647107369924282),
|
||||
("integer (numeric)July", -2.268683541318364)],
|
||||
n = 9}}),
|
||||
("<time> <part-of-day>",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -9.844007281325252e-2,
|
||||
@ -236,12 +240,12 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("mm/dd",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -1.3862943611198906,
|
||||
ClassData{prior = -1.4271163556401458,
|
||||
unseen = -2.0794415416798357,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 6},
|
||||
koData =
|
||||
ClassData{prior = -0.2876820724517809, unseen = -2.995732273553991,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 18}}),
|
||||
ClassData{prior = -0.2744368457017603, unseen = -3.044522437723423,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 19}}),
|
||||
("at <time-of-day>",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.10919929196499197,
|
||||
@ -291,8 +295,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("September",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.791759469228055,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 4},
|
||||
ClassData{prior = 0.0, unseen = -2.0794415416798357,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 6},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -386,8 +390,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("October",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.833213344056216,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 15},
|
||||
ClassData{prior = 0.0, unseen = -2.890371757896165,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 16},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -537,232 +541,234 @@ classifiers
|
||||
n = 3}}),
|
||||
("intersect",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.4634795031687923, unseen = -6.169610732491456,
|
||||
ClassData{prior = -0.467109271219371, unseen = -6.171700597410915,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("<datetime> - <datetime> (interval)on <date>",
|
||||
-4.558078578454241),
|
||||
-4.560172820057356),
|
||||
("<time-of-day> - <time-of-day> (interval)on <date>",
|
||||
-4.558078578454241),
|
||||
("hourday", -3.769621218089971),
|
||||
("dayhour", -3.223077511721901),
|
||||
("daymonth", -4.781222129768451),
|
||||
("monthday", -5.0689042022202315),
|
||||
("monthyear", -3.8649313978942956),
|
||||
("Tuesdaythe <day-of-month> (ordinal)", -5.474369310328396),
|
||||
("Christmasyear", -5.474369310328396),
|
||||
-4.560172820057356),
|
||||
("hourday", -3.7717154596930853),
|
||||
("dayhour", -3.2251717533250157),
|
||||
("daymonth", -4.783316371371566),
|
||||
("monthday", -5.070998443823346),
|
||||
("monthyear", -3.8670256394974105),
|
||||
("Tuesdaythe <day-of-month> (ordinal)", -5.476463551931511),
|
||||
("Christmasyear", -5.476463551931511),
|
||||
("from <datetime> - <datetime> (interval)July",
|
||||
-5.474369310328396),
|
||||
("houryear", -5.474369310328396),
|
||||
-5.476463551931511),
|
||||
("houryear", -5.476463551931511),
|
||||
("this|next <day-of-week>hh(:mm) - <time-of-day> am|pm",
|
||||
-5.474369310328396),
|
||||
-5.476463551931511),
|
||||
("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",
|
||||
-4.781222129768451),
|
||||
("<time-of-day> am|pmintersect", -4.221606341833028),
|
||||
-4.783316371371566),
|
||||
("<time-of-day> am|pmintersect", -4.223700583436143),
|
||||
("intersect by \",\", \"of\", \"from\", \"'s\"year",
|
||||
-5.474369310328396),
|
||||
("Marchyear", -5.474369310328396),
|
||||
-5.476463551931511),
|
||||
("Marchyear", -5.476463551931511),
|
||||
("<named-month>|<named-day> <day-of-month> (ordinal)year",
|
||||
-5.0689042022202315),
|
||||
("intersect<time-of-day> am|pm", -5.474369310328396),
|
||||
("Thursdayhh(:mm) - <time-of-day> am|pm", -5.474369310328396),
|
||||
("monthhour", -5.0689042022202315),
|
||||
("last <day-of-week> of <time>year", -5.474369310328396),
|
||||
("todayat <time-of-day>", -5.474369310328396),
|
||||
("Thursday<time> timezone", -5.0689042022202315),
|
||||
-5.070998443823346),
|
||||
("intersect<time-of-day> am|pm", -5.476463551931511),
|
||||
("Thursdayhh(:mm) - <time-of-day> am|pm", -5.476463551931511),
|
||||
("monthhour", -5.070998443823346),
|
||||
("last <day-of-week> of <time>year", -5.476463551931511),
|
||||
("todayat <time-of-day>", -5.476463551931511),
|
||||
("Thursday<time> timezone", -5.070998443823346),
|
||||
("this <time>hh(:mm) - <time-of-day> am|pm",
|
||||
-5.474369310328396),
|
||||
("dayday", -3.459466289786131),
|
||||
("Thanksgiving Dayyear", -4.375757021660286),
|
||||
("<time> <part-of-day>at <time-of-day>", -5.474369310328396),
|
||||
("Tuesdayin <named-month>", -5.474369310328396),
|
||||
("mm/ddat <time-of-day>", -5.474369310328396),
|
||||
("tonightat <time-of-day>", -5.474369310328396),
|
||||
-5.476463551931511),
|
||||
("dayday", -3.461560531389246),
|
||||
("Thanksgiving Dayyear", -4.377851263263401),
|
||||
("<time> <part-of-day>at <time-of-day>", -5.476463551931511),
|
||||
("Tuesdayin <named-month>", -5.476463551931511),
|
||||
("mm/ddat <time-of-day>", -5.476463551931511),
|
||||
("tonightat <time-of-day>", -5.476463551931511),
|
||||
("<time-of-day> am|pmabsorption of , after named day",
|
||||
-4.781222129768451),
|
||||
("today<time-of-day> am|pm", -5.474369310328396),
|
||||
("Februarythe <day-of-month> (ordinal)", -5.0689042022202315),
|
||||
("at <time-of-day><time> <part-of-day>", -5.474369310328396),
|
||||
("mm/dd<time-of-day> am|pm", -5.474369310328396),
|
||||
("hourhour", -4.221606341833028),
|
||||
("<time-of-day> am|pmon <date>", -3.459466289786131),
|
||||
("Wednesdaythis|last|next <cycle>", -5.474369310328396),
|
||||
-4.783316371371566),
|
||||
("today<time-of-day> am|pm", -5.476463551931511),
|
||||
("Februarythe <day-of-month> (ordinal)", -5.070998443823346),
|
||||
("at <time-of-day><time> <part-of-day>", -5.476463551931511),
|
||||
("mm/dd<time-of-day> am|pm", -5.476463551931511),
|
||||
("hourhour", -4.223700583436143),
|
||||
("<time-of-day> am|pmon <date>", -3.461560531389246),
|
||||
("Wednesdaythis|last|next <cycle>", -5.476463551931511),
|
||||
("intersect<named-month> <day-of-month> (non ordinal)",
|
||||
-3.970291913552122),
|
||||
("dayyear", -3.0320222749591914),
|
||||
("last weekend of <named-month>year", -5.474369310328396),
|
||||
-3.9723861551552364),
|
||||
("dayyear", -3.0341165165623063),
|
||||
("last weekend of <named-month>year", -5.476463551931511),
|
||||
("<time-of-day> o'clockin|during the <part-of-day>",
|
||||
-5.474369310328396),
|
||||
("<time-of-day> am|pmtomorrow", -4.781222129768451),
|
||||
("minutehour", -4.558078578454241),
|
||||
("Mother's Dayyear", -5.474369310328396),
|
||||
-5.476463551931511),
|
||||
("<time-of-day> am|pmtomorrow", -4.783316371371566),
|
||||
("minutehour", -4.560172820057356),
|
||||
("Mother's Dayyear", -5.476463551931511),
|
||||
("at <time-of-day>in|during the <part-of-day>",
|
||||
-5.0689042022202315),
|
||||
-5.070998443823346),
|
||||
("absorption of , after named day<named-month> <day-of-month> (non ordinal)",
|
||||
-3.769621218089971),
|
||||
("for <duration> from <time>December", -5.474369310328396),
|
||||
("tomorrow<time-of-day> sharp|exactly", -5.474369310328396),
|
||||
-3.7717154596930853),
|
||||
("for <duration> from <time>December", -5.476463551931511),
|
||||
("tomorrow<time-of-day> sharp|exactly", -5.476463551931511),
|
||||
("Thursdayfrom <datetime> - <datetime> (interval)",
|
||||
-4.558078578454241),
|
||||
-4.560172820057356),
|
||||
("on <date><named-month> <day-of-month> (non ordinal)",
|
||||
-5.0689042022202315),
|
||||
-5.070998443823346),
|
||||
("Thursdayfrom <time-of-day> - <time-of-day> (interval)",
|
||||
-4.558078578454241),
|
||||
("Mondayin|during the <part-of-day>", -5.474369310328396),
|
||||
-4.560172820057356),
|
||||
("Mondayin|during the <part-of-day>", -5.476463551931511),
|
||||
("tomorrowfrom <time-of-day> - <time-of-day> (interval)",
|
||||
-5.0689042022202315),
|
||||
("intersectin|during the <part-of-day>", -5.474369310328396),
|
||||
-5.070998443823346),
|
||||
("intersectin|during the <part-of-day>", -5.476463551931511),
|
||||
("<day-of-month> (ordinal or number) of <named-month>in|during the <part-of-day>",
|
||||
-5.474369310328396),
|
||||
-5.476463551931511),
|
||||
("from <time-of-day> - <time-of-day> (interval)on <date>",
|
||||
-4.781222129768451),
|
||||
-4.783316371371566),
|
||||
("intersect by \",\", \"of\", \"from\", \"'s\"<time-of-day> am|pm",
|
||||
-4.558078578454241),
|
||||
("at <time-of-day>intersect", -5.0689042022202315),
|
||||
-4.560172820057356),
|
||||
("at <time-of-day>intersect", -5.070998443823346),
|
||||
("<time-of-day> - <time-of-day> (interval)tomorrow",
|
||||
-5.474369310328396),
|
||||
-5.476463551931511),
|
||||
("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",
|
||||
-5.474369310328396),
|
||||
("dayminute", -3.1717842173343502),
|
||||
-5.476463551931511),
|
||||
("dayminute", -3.173878458937465),
|
||||
("from <datetime> - <datetime> (interval)on <date>",
|
||||
-5.0689042022202315),
|
||||
-5.070998443823346),
|
||||
("<datetime> - <datetime> (interval)tomorrow",
|
||||
-5.474369310328396),
|
||||
-5.476463551931511),
|
||||
("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",
|
||||
-5.0689042022202315),
|
||||
("<ordinal> <cycle> of <time>year", -5.474369310328396),
|
||||
("minuteday", -2.0731719286662407),
|
||||
-5.070998443823346),
|
||||
("<ordinal> <cycle> of <time>year", -5.476463551931511),
|
||||
("minuteday", -2.075266170269355),
|
||||
("absorption of , after named dayintersect",
|
||||
-5.474369310328396),
|
||||
("Octoberyear", -4.221606341833028),
|
||||
-5.476463551931511),
|
||||
("Octoberyear", -4.223700583436143),
|
||||
("the <day-of-month> (ordinal)in|during the <part-of-day>",
|
||||
-5.474369310328396),
|
||||
-5.476463551931511),
|
||||
("at <time-of-day>absorption of , after named day",
|
||||
-5.474369310328396),
|
||||
-5.476463551931511),
|
||||
("<day-of-month> (ordinal or number) <named-month>year",
|
||||
-5.474369310328396),
|
||||
("year<time-of-day> am|pm", -5.474369310328396),
|
||||
("Septemberyear", -5.0689042022202315),
|
||||
("at <time-of-day>on <date>", -4.375757021660286),
|
||||
-5.476463551931511),
|
||||
("year<time-of-day> am|pm", -5.476463551931511),
|
||||
("Septemberyear", -5.070998443823346),
|
||||
("at <time-of-day>on <date>", -4.377851263263401),
|
||||
("between <time-of-day> and <time-of-day> (interval)on <date>",
|
||||
-4.781222129768451),
|
||||
("Halloweenyear", -5.474369310328396),
|
||||
("dayweek", -5.474369310328396),
|
||||
("weekyear", -5.0689042022202315),
|
||||
("hh:mmin|during the <part-of-day>", -4.781222129768451),
|
||||
("Father's Dayyear", -5.474369310328396),
|
||||
-4.783316371371566),
|
||||
("Halloweenyear", -5.476463551931511),
|
||||
("dayweek", -5.476463551931511),
|
||||
("weekyear", -5.070998443823346),
|
||||
("hh:mmin|during the <part-of-day>", -4.783316371371566),
|
||||
("Father's Dayyear", -5.476463551931511),
|
||||
("<cycle> after|before <time><time-of-day> am|pm",
|
||||
-5.0689042022202315),
|
||||
("February<time> <part-of-day>", -5.474369310328396),
|
||||
("Martin Luther King's Dayyear", -5.0689042022202315),
|
||||
("tomorrowat <time-of-day>", -4.781222129768451),
|
||||
("between <time> and <time>on <date>", -4.781222129768451),
|
||||
("at <time-of-day>tomorrow", -5.0689042022202315),
|
||||
("tomorrow<time-of-day> am|pm", -5.474369310328396),
|
||||
-5.070998443823346),
|
||||
("February<time> <part-of-day>", -5.476463551931511),
|
||||
("Martin Luther King's Dayyear", -5.070998443823346),
|
||||
("tomorrowat <time-of-day>", -4.783316371371566),
|
||||
("between <time> and <time>on <date>", -4.783316371371566),
|
||||
("at <time-of-day>tomorrow", -5.070998443823346),
|
||||
("tomorrow<time-of-day> am|pm", -5.476463551931511),
|
||||
("in|during the <part-of-day>at <time-of-day>",
|
||||
-5.474369310328396),
|
||||
("black fridayyear", -5.0689042022202315),
|
||||
("Labor Dayyear", -5.474369310328396),
|
||||
("Februaryintersect", -5.474369310328396),
|
||||
("last <cycle> of <time>year", -4.781222129768451),
|
||||
-5.476463551931511),
|
||||
("black fridayyear", -5.070998443823346),
|
||||
("Labor Dayyear", -5.476463551931511),
|
||||
("Februaryintersect", -5.476463551931511),
|
||||
("last <cycle> of <time>year", -4.783316371371566),
|
||||
("<named-month> <day-of-month> (non ordinal)year",
|
||||
-5.474369310328396),
|
||||
("yearminute", -5.474369310328396)],
|
||||
-5.476463551931511),
|
||||
("yearminute", -5.476463551931511)],
|
||||
n = 173},
|
||||
koData =
|
||||
ClassData{prior = -0.9917982843823002, unseen = -5.817111159963204,
|
||||
ClassData{prior = -0.9856718774875143, unseen = -5.82600010738045,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("in <named-month>year", -5.120983351265121),
|
||||
[("in <named-month>year", -5.1298987149230735),
|
||||
("<time-of-day> - <time-of-day> (interval)on <date>",
|
||||
-5.120983351265121),
|
||||
("hourday", -5.120983351265121),
|
||||
-5.1298987149230735),
|
||||
("hourday", -5.1298987149230735),
|
||||
("<named-month> <day-of-month> (non ordinal)July",
|
||||
-5.120983351265121),
|
||||
("dayhour", -3.329223882037066),
|
||||
("daymonth", -3.041541809585285),
|
||||
("monthday", -4.715518243156957),
|
||||
("monthyear", -4.427836170705175),
|
||||
("intersecthh:mm", -5.120983351265121),
|
||||
-5.1298987149230735),
|
||||
("dayhour", -3.3381392456950185),
|
||||
("daymonth", -3.0504571732432377),
|
||||
("monthday", -4.724433606814909),
|
||||
("monthyear", -4.436751534363128),
|
||||
("intersecthh:mm", -5.1298987149230735),
|
||||
("from <datetime> - <datetime> (interval)July",
|
||||
-5.120983351265121),
|
||||
("houryear", -5.120983351265121),
|
||||
-5.1298987149230735),
|
||||
("houryear", -5.1298987149230735),
|
||||
("from <time-of-day> - <time-of-day> (interval)July",
|
||||
-5.120983351265121),
|
||||
("until <time-of-day><time-of-day> am|pm", -5.120983351265121),
|
||||
-5.1298987149230735),
|
||||
("until <time-of-day><time-of-day> am|pm", -5.1298987149230735),
|
||||
("<time-of-day> am|pmintersect by \",\", \"of\", \"from\", \"'s\"",
|
||||
-4.427836170705175),
|
||||
("<time-of-day> am|pmintersect", -3.868220382769753),
|
||||
-4.436751534363128),
|
||||
("<time-of-day> am|pmintersect", -3.8771357464277054),
|
||||
("intersect by \",\", \"of\", \"from\", \"'s\"year",
|
||||
-4.204692619390966),
|
||||
("Tuesdayafter <time-of-day>", -5.120983351265121),
|
||||
-4.213607983048918),
|
||||
("Tuesdayafter <time-of-day>", -5.1298987149230735),
|
||||
("July<day-of-month> (ordinal or number) <named-month>",
|
||||
-5.120983351265121),
|
||||
("absorption of , after named dayJuly", -4.715518243156957),
|
||||
("monthhour", -4.715518243156957),
|
||||
("hourmonth", -4.427836170705175),
|
||||
("todayat <time-of-day>", -5.120983351265121),
|
||||
("dayday", -4.715518243156957),
|
||||
("mm/ddat <time-of-day>", -4.715518243156957),
|
||||
("<time-of-day> am|pmon <date>", -3.868220382769753),
|
||||
("dayyear", -3.868220382769753),
|
||||
("Thursdaymm/dd", -5.120983351265121),
|
||||
("Thursdayat <time-of-day>", -5.120983351265121),
|
||||
("August<time-of-day> am|pm", -5.120983351265121),
|
||||
("monthminute", -5.120983351265121),
|
||||
("<time-of-day> am|pmtomorrow", -5.120983351265121),
|
||||
("Thursdayhh:mm", -5.120983351265121),
|
||||
-5.1298987149230735),
|
||||
("absorption of , after named dayJuly", -4.724433606814909),
|
||||
("monthhour", -4.724433606814909),
|
||||
("hourmonth", -4.436751534363128),
|
||||
("todayat <time-of-day>", -5.1298987149230735),
|
||||
("dayday", -4.724433606814909),
|
||||
("mm/ddat <time-of-day>", -4.724433606814909),
|
||||
("<time-of-day> am|pmon <date>", -3.8771357464277054),
|
||||
("dayyear", -3.8771357464277054),
|
||||
("Thursdaymm/dd", -5.1298987149230735),
|
||||
("Thursdayat <time-of-day>", -5.1298987149230735),
|
||||
("<integer> to|till|before <hour-of-day>September",
|
||||
-5.1298987149230735),
|
||||
("August<time-of-day> am|pm", -5.1298987149230735),
|
||||
("monthminute", -5.1298987149230735),
|
||||
("<time-of-day> am|pmtomorrow", -5.1298987149230735),
|
||||
("Thursdayhh:mm", -5.1298987149230735),
|
||||
("August<day-of-month> (ordinal or number) <named-month>",
|
||||
-5.120983351265121),
|
||||
("Fridayyear", -4.715518243156957),
|
||||
("minutemonth", -3.5115454388310208),
|
||||
-5.1298987149230735),
|
||||
("Fridayyear", -4.724433606814909),
|
||||
("minutemonth", -3.425150622684648),
|
||||
("Thursdayfrom <datetime> - <datetime> (interval)",
|
||||
-4.715518243156957),
|
||||
-4.724433606814909),
|
||||
("Thursdayfrom <time-of-day> - <time-of-day> (interval)",
|
||||
-4.715518243156957),
|
||||
("Aprilyear", -5.120983351265121),
|
||||
-4.724433606814909),
|
||||
("Aprilyear", -5.1298987149230735),
|
||||
("mm/dd<time-of-day> - <time-of-day> (interval)",
|
||||
-4.715518243156957),
|
||||
-4.724433606814909),
|
||||
("tomorrowfrom <time-of-day> - <time-of-day> (interval)",
|
||||
-5.120983351265121),
|
||||
-5.1298987149230735),
|
||||
("<duration> after|before|from <time>December",
|
||||
-5.120983351265121),
|
||||
("yesterday<time-of-day> am|pm", -5.120983351265121),
|
||||
-5.1298987149230735),
|
||||
("yesterday<time-of-day> am|pm", -5.1298987149230735),
|
||||
("intersect by \",\", \"of\", \"from\", \"'s\"hh:mm",
|
||||
-4.204692619390966),
|
||||
-4.213607983048918),
|
||||
("<named-month> <day-of-month> (non ordinal)August",
|
||||
-5.120983351265121),
|
||||
("until <time-of-day>on <date>", -4.427836170705175),
|
||||
("at <time-of-day>intersect", -4.715518243156957),
|
||||
-5.1298987149230735),
|
||||
("until <time-of-day>on <date>", -4.436751534363128),
|
||||
("at <time-of-day>intersect", -4.724433606814909),
|
||||
("at <time-of-day>intersect by \",\", \"of\", \"from\", \"'s\"",
|
||||
-5.120983351265121),
|
||||
("dayminute", -3.175073202209808),
|
||||
("intersectSeptember", -3.616905954488847),
|
||||
-5.1298987149230735),
|
||||
("dayminute", -3.18398856586776),
|
||||
("intersectSeptember", -3.6258213181467993),
|
||||
("absorption of , after named dayintersect by \",\", \"of\", \"from\", \"'s\"",
|
||||
-5.120983351265121),
|
||||
("minuteday", -2.317622970358586),
|
||||
-5.1298987149230735),
|
||||
("minuteday", -2.3265383340165386),
|
||||
("absorption of , after named dayintersect",
|
||||
-5.120983351265121),
|
||||
("Februaryin|during the <part-of-day>", -5.120983351265121),
|
||||
("week-endin <named-month>", -5.120983351265121),
|
||||
("Octoberyear", -5.120983351265121),
|
||||
("yearhh:mm", -5.120983351265121),
|
||||
("hh:mmon <date>", -3.616905954488847),
|
||||
-5.1298987149230735),
|
||||
("Februaryin|during the <part-of-day>", -5.1298987149230735),
|
||||
("week-endin <named-month>", -5.1298987149230735),
|
||||
("Octoberyear", -5.1298987149230735),
|
||||
("yearhh:mm", -5.1298987149230735),
|
||||
("hh:mmon <date>", -3.6258213181467993),
|
||||
("absorption of , after named daySeptember",
|
||||
-4.204692619390966),
|
||||
("on <date>September", -4.715518243156957),
|
||||
("at <time-of-day>on <date>", -4.715518243156957),
|
||||
("absorption of , after named dayFebruary", -4.204692619390966),
|
||||
-4.213607983048918),
|
||||
("on <date>September", -4.724433606814909),
|
||||
("at <time-of-day>on <date>", -4.724433606814909),
|
||||
("absorption of , after named dayFebruary", -4.213607983048918),
|
||||
("July<integer> to|till|before <hour-of-day>",
|
||||
-5.120983351265121),
|
||||
("tomorrowat <time-of-day>", -5.120983351265121),
|
||||
-5.1298987149230735),
|
||||
("tomorrowat <time-of-day>", -5.1298987149230735),
|
||||
("<integer> to|till|before <hour-of-day>July",
|
||||
-5.120983351265121),
|
||||
("tomorrow<time-of-day> am|pm", -5.120983351265121),
|
||||
("after <time-of-day><time-of-day> am|pm", -5.120983351265121),
|
||||
("after <time-of-day>year", -5.120983351265121),
|
||||
("yearminute", -5.120983351265121)],
|
||||
n = 102}}),
|
||||
-5.1298987149230735),
|
||||
("tomorrow<time-of-day> am|pm", -5.1298987149230735),
|
||||
("after <time-of-day><time-of-day> am|pm", -5.1298987149230735),
|
||||
("after <time-of-day>year", -5.1298987149230735),
|
||||
("yearminute", -5.1298987149230735)],
|
||||
n = 103}}),
|
||||
("after lunch/work/school",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.3862943611198906,
|
||||
@ -1343,18 +1349,17 @@ classifiers
|
||||
n = 1}}),
|
||||
("time-of-day (latent)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.5500463369192721, unseen = -4.143134726391533,
|
||||
ClassData{prior = -0.5596157879354228, unseen = -4.143134726391533,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("integer (numeric)", -0.10178269430994236),
|
||||
("integer (0..19)", -2.3353749158170367)],
|
||||
n = 60},
|
||||
koData =
|
||||
ClassData{prior = -0.8602012652231115,
|
||||
unseen = -3.8501476017100584,
|
||||
ClassData{prior = -0.8472978603872037, unseen = -3.871201010907891,
|
||||
likelihoods =
|
||||
HashMap.fromList [("integer (numeric)", -2.197890671877523e-2)],
|
||||
n = 44}}),
|
||||
HashMap.fromList [("integer (numeric)", -2.150620522096362e-2)],
|
||||
n = 45}}),
|
||||
("year",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.2113090936672069, unseen = -3.58351893845611,
|
||||
@ -1897,9 +1902,9 @@ classifiers
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0},
|
||||
koData =
|
||||
ClassData{prior = 0.0, unseen = -3.2188758248682006,
|
||||
ClassData{prior = 0.0, unseen = -3.258096538021482,
|
||||
likelihoods = HashMap.fromList [("integer (numeric)", 0.0)],
|
||||
n = 23}}),
|
||||
n = 24}}),
|
||||
("about|exactly <duration>",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.6094379124341003,
|
||||
@ -2116,8 +2121,8 @@ classifiers
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("ordinal (digits)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -3.4339872044851463,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 29},
|
||||
ClassData{prior = 0.0, unseen = -3.5553480614894135,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 33},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
@ -2285,6 +2290,24 @@ classifiers
|
||||
ClassData{prior = -3.2188758248682006,
|
||||
unseen = -1.0986122886681098,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 1}}),
|
||||
("dd-dd <month> (interval)",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -2.9444389791664407,
|
||||
likelihoods =
|
||||
HashMap.fromList
|
||||
[("integer (numeric)integer (numeric)September",
|
||||
-1.791759469228055),
|
||||
("ordinal (digits)ordinal (digits)July", -2.1972245773362196),
|
||||
("ordinal (digits)ordinal (digits)October",
|
||||
-2.1972245773362196),
|
||||
("integer (numeric)integer (numeric)July", -2.1972245773362196),
|
||||
("month", -0.9444616088408514),
|
||||
("ordinal (digits)ordinal (digits)August",
|
||||
-2.1972245773362196)],
|
||||
n = 6},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -1.9459101490553135,
|
||||
likelihoods = HashMap.fromList [], n = 0}}),
|
||||
("this <time>",
|
||||
Classifier{okData =
|
||||
ClassData{prior = -0.10536051565782628,
|
||||
@ -2309,8 +2332,8 @@ classifiers
|
||||
n = 1}}),
|
||||
("August",
|
||||
Classifier{okData =
|
||||
ClassData{prior = 0.0, unseen = -1.9459101490553135,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 5},
|
||||
ClassData{prior = 0.0, unseen = -2.0794415416798357,
|
||||
likelihoods = HashMap.fromList [("", 0.0)], n = 6},
|
||||
koData =
|
||||
ClassData{prior = -infinity, unseen = -0.6931471805599453,
|
||||
likelihoods = HashMap.fromList [], n = 0}})]
|
@ -900,4 +900,17 @@ allExamples = concat
|
||||
[ "August 27th - 29th"
|
||||
, "from August 27th - 29th"
|
||||
]
|
||||
, examples (datetimeInterval ((2013, 10, 23, 0, 0, 0), (2013, 10, 27, 0, 0, 0)) Day)
|
||||
[ "23rd to 26th Oct"
|
||||
]
|
||||
, examples (datetimeInterval ((2013, 9, 1, 0, 0, 0), (2013, 9, 9, 0, 0, 0)) Day)
|
||||
[ "1-8 september"
|
||||
]
|
||||
, examples (datetimeInterval ((2013, 9, 12, 0, 0, 0), (2013, 9, 17, 0, 0, 0)) Day)
|
||||
[ "12 to 16 september"
|
||||
]
|
||||
, examples (datetimeInterval ((2013, 8, 19, 0, 0, 0), (2013, 8, 22, 0, 0, 0)) Day)
|
||||
[ "19th To 21st aug"
|
||||
]
|
||||
|
||||
]
|
||||
|
@ -944,6 +944,27 @@ ruleIntervalMonthDDDD = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleIntervalDDDDMonth :: Rule
|
||||
ruleIntervalDDDDMonth = Rule
|
||||
{ name = "dd-dd <month> (interval)"
|
||||
, pattern =
|
||||
[ Predicate isDOMValue
|
||||
, regex "\\-|to|th?ru|through|(un)?til(l)?"
|
||||
, Predicate isDOMValue
|
||||
, Predicate isAMonth
|
||||
]
|
||||
, prod = \tokens -> case tokens of
|
||||
(token1:
|
||||
_:
|
||||
token2:
|
||||
Token Time td:
|
||||
_) -> do
|
||||
dom1 <- intersectDOM td token1
|
||||
dom2 <- intersectDOM td token2
|
||||
Token Time <$> interval TTime.Closed dom1 dom2
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleIntervalFromMonthDDDD :: Rule
|
||||
ruleIntervalFromMonthDDDD = Rule
|
||||
{ name = "from <month> dd-dd (interval)"
|
||||
@ -1688,6 +1709,7 @@ rules =
|
||||
, ruleIntervalFromMonthDDDD
|
||||
, ruleIntervalFromDDDDMonth
|
||||
, ruleIntervalMonthDDDD
|
||||
, ruleIntervalDDDDMonth
|
||||
, ruleIntervalDash
|
||||
, ruleIntervalFrom
|
||||
, ruleIntervalBetween
|
||||
|
Loading…
Reference in New Issue
Block a user