GSoC 2019 Phase 1, 2 & 3 work submission#14
Conversation
| import org.mifos.chatbot.core.model.Intent; | ||
|
|
||
| class SmallTalk { | ||
| private static final String[] SMALL_TALK_INTENTS = { |
There was a problem hiding this comment.
Can we move this to a static file for logical separation, and easy modification later.
There was a problem hiding this comment.
made interface SmallTalkService for that. And moved isSmallTalkRequest from SmallTalk.java to SmallTalkHandler.
| @Component | ||
| public class ArrearDayHandler extends BaseLoanIntentHandler { | ||
| private static final String[] INTENT_KEYWORDS = {"arrear", "day"}; | ||
| private static final String[] INTENT_KEYWORDS = {"arrear_day"}; |
There was a problem hiding this comment.
This INTENT_KEYWORDS is specific for this class, so my intention is to keep it here or should i move it?
| @Component | ||
| public class ClientActivationDateHandler extends BaseLoanIntentHandler { | ||
| private static final String[] INTENT_KEYWORDS = {"client", "activation", "date"}; | ||
| private static final String[] INTENT_KEYWORDS = {"client_activation_date"}; |
There was a problem hiding this comment.
All such hard coded strings to static files
| @Component | ||
| public class NextDueDateHandler extends BaseLoanIntentHandler { | ||
| private static final String[] INTENT_KEYWORDS = {"Due", "Date"}; | ||
| private static final String[] INTENT_KEYWORDS = {"due_date"}; |
There was a problem hiding this comment.
potentially add stemming/lemmatization based matching for these intent keywords?
| String intentKeyword = intent.getKeyword().toLowerCase(); | ||
| MifosResponse mifosResponse = new MifosResponse(); | ||
| for(int i=0; i<INTENT_KEYWORDS.length; i++) { | ||
| if(intentKeyword.equals(INTENT_KEYWORDS[i])) { |
There was a problem hiding this comment.
Can override equals to an approx equals function here which includes some stemming/lemmatization/general intent based matching rather than exact matches.
There was a problem hiding this comment.
These is used to match the intent names predicted by rasa NLU model (most confident one) and those intent names are defined in Rasa dataset (rasa/data/nlu.md) as well as SmallTalkService.java (org/mifos/chatbot/core/SmallTalkService.java) so that's why i used equal rather than partial equal. And for lemmatization i am now using spacy.lemma
| ``` | ||
| create table users_creds | ||
| ( | ||
| username varchar(255) not null, |
There was a problem hiding this comment.
Can potentially look into encrypting these fields at the database level for when we want to extend this work.
| @Component | ||
| public class ArrearDayHandler extends BaseLoanIntentHandler { | ||
| private static final String[] INTENT_KEYWORDS = {"arrear", "day"}; | ||
| private static final String[] INTENT_KEYWORDS = {"arrear_day"}; |
| @Component | ||
| public class ClientActivationDateHandler extends BaseLoanIntentHandler { | ||
| private static final String[] INTENT_KEYWORDS = {"client", "activation", "date"}; | ||
| private static final String[] INTENT_KEYWORDS = {"client_activation_date"}; |
| for (String token : input.split(" ")) { | ||
| try { | ||
| id = Long.parseLong(token); | ||
| } catch (NumberFormatException e) { |
There was a problem hiding this comment.
Should be handled, ideally. If this isn't expected, you should trigger some sort of alerting.
|
|
||
| @Override | ||
| public void onUpdateReceived(Update update) { | ||
| if (update.hasMessage() && update.getMessage().hasText()) { |
|
i want to contribute int this project. |
|
Can this PR be merged so further progress could be done please? |
|
of course... will do as soon as I'm back at my desk
…On Thu, Feb 27, 2020, 11:25 Arsh Singh ***@***.***> wrote:
Can this PR be merged so further progress could be done please?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#14?email_source=notifications&email_token=AAC4ZL5CS42SFGSRZFEQGWLRE6ILJA5CNFSM4H2XMBXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENDZYZY#issuecomment-591895655>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC4ZLZ7UCE4KQXLJYPHC7LRE6ILJANCNFSM4H2XMBXA>
.
|
overview:
Fixes:
#9 #11 #13 and #12