From 1b176c3665266ce5a8cabf815ff40c00ea3e5a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Wall=C3=A9n?= Date: Mon, 16 Oct 2017 12:09:36 -0700 Subject: [PATCH] Added support for understanding Swedish last expression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: One of the most common ways of saying "last \" in Swedish is saying "i \s", for example "i tisdags" (last Tuesday) or "i lördags" (last Saturday). This pull request adds support for this. Closes https://github.com/facebookincubator/duckling/pull/92 Reviewed By: blandinw, kodafb Differential Revision: D6064814 Pulled By: patapizza fbshipit-source-id: 6ea5466 --- Duckling/Ranking/Classifiers/SV_XX.hs | 50 +++++++++++++++++---------- Duckling/Time/SV/Corpus.hs | 1 + Duckling/Time/SV/Rules.hs | 27 +++++++++++---- 3 files changed, 52 insertions(+), 26 deletions(-) diff --git a/Duckling/Ranking/Classifiers/SV_XX.hs b/Duckling/Ranking/Classifiers/SV_XX.hs index 3da55b0ef..190a5004e 100644 --- a/Duckling/Ranking/Classifiers/SV_XX.hs +++ b/Duckling/Ranking/Classifiers/SV_XX.hs @@ -58,8 +58,8 @@ classifiers likelihoods = HashMap.fromList [("", 0.0)], n = 1}}), ("Tisdag", Classifier{okData = - ClassData{prior = 0.0, unseen = -2.3025850929940455, - likelihoods = HashMap.fromList [("", 0.0)], n = 8}, + ClassData{prior = 0.0, unseen = -2.3978952727983707, + likelihoods = HashMap.fromList [("", 0.0)], n = 9}, koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), @@ -757,6 +757,16 @@ classifiers koData = ClassData{prior = -infinity, unseen = -0.6931471805599453, likelihoods = HashMap.fromList [], n = 0}}), + ("last ", + Classifier{okData = + ClassData{prior = 0.0, unseen = -1.6094379124341003, + likelihoods = + HashMap.fromList + [("Tisdag", -0.6931471805599453), ("day", -0.6931471805599453)], + n = 1}, + koData = + ClassData{prior = -infinity, unseen = -1.0986122886681098, + likelihoods = HashMap.fromList [], n = 0}}), ("