All - Activity - Zylatis - Rasa Community Forum

Paraphrasing for NLU Data Augmentation

Nice example, and I’m also interested in this specifically for sentences containing entities. If I could wave a magic wand I’d say we need a way to tell the GPT model to leave alone and then we can backfill from a list later on and randomly sprinkle entities into that slot ourselves (assumes indepe…


Very interesting! I’ve always found data augmentation in NLP quite tricky, especially with NER. Are there details of your model/training data anywhere or that is private?


You may have better luck treating this as a NER problem and trying to extract the section number from the text and have some conversation flow/database query action based on that. In the examples in your initial post you could do something similar, or also just do a keyword lookup (though not actua…


Oh okay, so essentially the lookup table will be tokenized into single words and the featuriser will have the ‘in_lookup’ = 1 for each of these words, right?


Thanks for the info @Ghostvv! Could you please clarify what you mean by ‘the same’, perhaps with a single and multiword example? Thanks, Z


I really like this line of thinking but I’m curious @lgrinberg how your initial setup (firstname, lastname, etc) would cope if the person decided to give all of their information at once? (as users are won’t to do sometimes, ignoring prompts etc). I suppose one would either need to a.) ignore/don’t…


Hi @amn41, thanks for the info. For now I have gone with this

which is pretty neat, though I maintain it would be really great to have something like this built into Rasa X, i.e. be able to annotate data that was externally generated (i.e. not coming from a Rasa Core convo) and then use that as t…


Same!


I’m trying to do address extraction from free text and would like to understand better how the lookup table impacts the CRF so I can format things optimally. In the simplest case of each token being a single word, I understand how we can add a feature to the CRF input which just says ‘is this word …


Hi, I was wondering if it’s possible to add a google NLU api call to the list of NLU components being used, or if this would need to be added as a custom component? My use case is worldwide address extraction (I’ve had trouble getting the inbuilt CRF to perform well on this, any tips appreciated!)


Hi, I currently using Rasa NLU with a different custom dialog manager and I was wondering if there is any way, or any plans to enable a way, to use Rasa X’s super cool conversation investigation/labeling stuff to just work with NLU snippets? Basically I’d like to present individual sentences to peo…


Hi! If you are doing a direct call to Rasa NLU you should get the confidence scores back. Are you using Rasa NLU with Rasa Core? If so I’m not sure how to play with that other than playing with the fallback threshold which will make the bot utter the default ‘i dunno’ message


Ah no you are write - I found earlier but forgot to reply here. I think previously I didn’t have proper components or something loaded, now I get spacy and CRF ner side by side! Thanks for replies!


Can you give an example of the annotation and the output of the NLU parsing command?


Do you get spacy results and CRF results separately for extracted entities?


In my experience if I had CRF and Spacy, only CRF would appear.


I am interested in this as well. I feel like maybe integration with flair might be the most straightforward first step? It can integrate with BERT, allows custom model training, and does NER, though I’ve not yet experimented with using BERT for NER specifically, and then integration with Rasa on top…


I’d like to clarify some things in this convo as I have much the same question as OP. My understanding is that currently the tensorflow embedding only concerns intent classification and that it has naught to do with entity extraction and ner_crf stuff. In my case I have a large dataset ~80k because…


Hi, I am using NLU to extract pickup and dropoff entities for a quoting system. Currently I am relying on the CRF extractor to get custom entities for two reasons: 1.) the locations aren’t in standard NLP packages afaik (they’re Aussie suburbs and postcodes) and 2.) I don’t want to assume people wi…


I have a bunch of stories which make use of checkpoints to essentially give deterministic loop. However, I find that I need to increase the memoization policy size quite a bit in order to memorise all the stories. My understanding that the tracker, when in a given state, would survey the given stor…


My actions.py is currently a complete dogs breakfast of Python which nobody should have to look upon =P But I did end up hardcoding it and it’s quite easy, I think I had a bug last time I tried this which put me off. if current_slot_values['quote_begun'] == None: if latest_message['intent']['name']…


Yep, that’s what I’ve got going at the moment! It’s a solid workaround but does make things a little clunky, as I have several forms that need it, adds to slot proliferation. Thanks for the good discussion!


Hi, I have multiple intents going and I want to do something like this:

new_quote2


I have a bot which makes use of some fuzzy matching to pair suburbs and postcodes which are not currently part of any intent but are parsed manually at certain points in the form. I also have an intent which is ‘interrupt’ which involves things like quit and restart and break out of the form and so …


No I meant it is asking the validate question and then re-asking the original question, I am trying to avoid this.


Ah okay so you overrode that function, that is why, right?


Interesting, mine always re-asks the ‘ask_slot’ before getting to validate, I will investigate. To clarify: did you mean to include the code snippet of def request_next-slot() at the bottom?


Okay but what if your validation fails a second time?


Ah okay but this comes back to the original problem (unless you also redefined request next slot, the body of which is cut off in your post). In your case, if Date is what I want to fill then it will utter your ‘sorry’ message but then also utter ask_date afterwards because date is None, right?


Oh I see, you mean you have a ‘is_validated’ flag/slot? Nice idea. I had thought about using that but to enable story branching, perhaps I was over-complicating things! I think the trick is still to return a custom message after the utter_ask, not before. EDIT: A possible way around this is to have…


Ah no not like that. What I’m talking about goes on here which will always utter_ask_slot regardless of context, i.e. if it is the first time the user has been asked this, or if the form is asking again because of clarification. One would expect these to be different, and so reasonably should be …


Ah yes thank you, came across that but forgot to update my post! My error was not re-calling the form after the resumption call and having the error throwing in the form action commented out. Thanks! EDIT: Is it also possible to do something like this for more complicated validation of form slots…


Hey, I have a form which asks for a bunch of things that each need different clarification. For example if the form asks for a suburb and postcode it needs to check if they are a valid match before proceeding. Currently in validate() I can do this check, set those slots to None again so the form kn…


Hi, I currently have a kind of FormBot which asks the user to input details about an item they want shipped. However, they can also add more items (‘rows’) towards the end, and so I have used checkpoints to enable this loop. I also want the user to be able to interrupt and restart the process at a…


Hard to say without knowing where the information is stored: is the set of solutions stored somewhere or accessed through an API in a custom action or something? What I’m getting at is that you could deal with this conditionally inside the action itself, or some intermediate action, which gets as a…


I have also found that only the custom action way works, not the story slot filling way, anyone else found this?


@akelad Ah okay, probably then I don’t understand forms enough. For example, if I had Story A with FormA and I wanted to break out of that form before completion to go to Story B, based on some condition, how would I do that? For example, I understand I can use self.deactivate from within the form, …


Why would you need to write other stories? I think in the FormAction you can just maintain a list of ‘interrupt intents’ so if the NLU extracts one of those you can hit the deactivate button and do something else. How you deal with the dialog flow after the deactivation is a bit different and probab…


I have a form which during validation I check in a custom way, and if that validation fails I want to ask them to check the formatting of particular entities. Based on the FormBot example I do the check in validate() and then if this fails, submit an utterance to the tracker and set the correspondi…


Ah right, I’m currently just using ner_crf and spacy for other stuff language: "en" pipeline:


I really like being able to extract based on intent in slot mappings, but I don’t see a way here https://rasa.com/docs/core/_modules/rasa_core_sdk/forms/#FormAction to select based on extractor, is this possible now/in future? I ask because if I am extracting a number the ner_crf gives a string whe…


It says there is no memorised next action, have you tried turning that on in the policy stuff to see if it works? What happens if instead of the form you just have it utter something, does that trigger?


Excellent timing, I need new shirts!


Answering my own question: it seems that a different endpoint is not required as a single bot with single action server etc is able to keep track of multiple ongoing independent conversations through the use of the ID/user in the tracker store, so it’s all neatly wrapped up =)


@srikar_1996 Agreed, and that is pretty much the action I use, though without the utter part, as I put that in the story. I also think this may lead to problems if you don’t have the name with ‘action_’ prefix as @aayush has. Regarding your point @aayush I’m not entirely sure. I also encountered an…


Perhaps I am misunderstanding your point about the entities not trained with intents, but in custom actions I believe you can deal with this (unless you are referring to a purely NLU problem, not Core, in which case I would need an example to understand better). Anyway, if you are talking about Core…


Okay then I’m not sure I understand your query. The method given there allows one to extract user input at a given point in a story no matter the intent, assuming one has gotten to that point in the story which is of course intent based. I have used this, for example, when asking for a reference nu…


If I understand correctly what you are looking for is this.