Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labs 2,3,4,5 submission #11

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Labs 2,3,4,5 submission #11

wants to merge 15 commits into from

Conversation

ariageng
Copy link

No description provided.

@ariageng ariageng changed the title Lab 2 work in progress Lab 2 submission Feb 15, 2024
@nastaiza14
Copy link
Collaborator

Hey! The machine works but needs some fixes:

  • It does not pick up time. The times that are in the grammar: 10 or 11, do not work.
  • After saying "yes" to "Will it take the whole day?" it jumps to "LastQuestion", but there's an error there.
  • Does not "autostart" after 10 seconds of waiting, check delayed transitions / after in XState v5 documentation.

Send me a message if you need help with any of this.

@ariageng
Copy link
Author

Hi Nastaiza,

I've revised dm.js now :)

@vladmaraev vladmaraev force-pushed the main branch 3 times, most recently from 389c1aa to f89ca27 Compare February 21, 2024 08:44
@nastaiza14
Copy link
Collaborator

Good work!!

@ariageng ariageng changed the title Lab 2 submission Labs 2,3 submission Feb 21, 2024
@ariageng ariageng changed the title Labs 2,3 submission Labs 2,3,4 submission Feb 27, 2024
@ariageng ariageng changed the title Labs 2,3,4 submission Labs 2,3,4,5 submission Mar 7, 2024
@nastaiza14
Copy link
Collaborator

Hello, for lab 4, there are a couple of issues:

  • when I want an appointment/meeting it takes me directly to Celebrity info, but you should have two intents, one for "celebrity info" and one for "meeting", mixing the two could be complicated.
  • when answering to the machine's "are you there?", it replies with " yes is not a day in the grammar".

I see that you have the "create a meeting" intent and some states for the meeting, but it seems that there is no way to access it. Let me know if you manage to fix that, otherwise you can message me and we can take a look at it together.

@ariageng
Copy link
Author

Hi Nastaiza,

Thank you for the feedback! I've revised and updated dm4.js
:)

Best,
Tianyi Geng

@nastaiza14
Copy link
Collaborator

Hey, for lab 4, the machine works, but there's something missing in the appointment section.
The point of the NLU part was that we get more flexibility in utterances when we "communicate" with the machine. With entities, for example, we recognize them in our full sentences and work with them, e.g. utterance: "I want to meet with Vlad", entity: "Vlad".
I see that your intents work for appointment, info on celebrities, and help, that's perfect, but in the appointment section the machine just recognizes names, days, times... in the grammar, which is not different from lab 2. What you could try doing is incorporating entities to recognize names, time/date, affirmation, etc. (take a look at lab 4 instructions on intents and entities). It doesn't have to be very complex, but try using those resources to some extent.

Since lab 5 is a continuation from 4, you can try putting everything together in lab 5. (You can also define "listen" in "setup({ actions: })", btw).

Feel free to message me if you need help and we can take a look together if needed.

@ariageng
Copy link
Author

Hi Nastaiza,

Thank you so much for the detailed instructions!
I've revised and updated dm5.js and now it is possible to make a detailed appointment or ask about a famous person in the first stage. "Help" and "Confirm" should be functioning as well.
:)

By the way, I've been having this question for a while. Do you know what could be the cause of the utterance being shown "one letter by another" in the statechart? It's not a big deal but I'm quite confused why it is like this.
image

Best,
Tianyi Geng

@nastaiza14
Copy link
Collaborator

Hey!
You managed to make the whole appointment in just one prompt, that's cool!! There is just one more fix (sorry) to make. If you don't say the whole sentence as intended or even say something like "I want an appointment" you get an error (that's sort of an out-of-grammar error). To avoid this, try checking the array of entities/intents first (check if its length is 0, 1, etc. for example).
One simple solution would be to check whether if intent "appointment" is detected but the corresponding entities are all not detected (name, day, time) then send the user to a prompt to remind them what they should say.

Also, that error of showing things letter by letter is very annoying. It happened to me after I defined custom actions in setup({})... Not sure why it happens though...

@ariageng
Copy link
Author

Hey! You managed to make the whole appointment in just one prompt, that's cool!! There is just one more fix (sorry) to make. If you don't say the whole sentence as intended or even say something like "I want an appointment" you get an error (that's sort of an out-of-grammar error). To avoid this, try checking the array of entities/intents first (check if its length is 0, 1, etc. for example). One simple solution would be to check whether if intent "appointment" is detected but the corresponding entities are all not detected (name, day, time) then send the user to a prompt to remind them what they should say.

Also, that error of showing things letter by letter is very annoying. It happened to me after I defined custom actions in setup({})... Not sure why it happens though...

Hi Nastaiza,

I'm sorry I'm kinda not making more progress for spliting the task into different situations...
I've tried to devide situations into "3 entities detected", "2 entities detected" and "1 entity detected" but some of the states do not work. I think it could be due to syntactic mistakes but I don't know how to fix it..

Would you check about it provide some advice for you? That would be very helpful. :)

@nastaiza14
Copy link
Collaborator

nastaiza14 commented Mar 28, 2024

Hey! Good job!! You were absolutely on the right track.
After a couple of hours I could not understand what the mistake was specifically, but I suspect it was related to the complex way in which you were handling guards. But your logic is correct.

The mistakes were found at Stage2, where guards didn't seem to be properly checked for some reason.
What I did was replacing your code in ListeningStage2 with the one you had in Stage1Listen (for the detection of the 3 entities).
After I did that, the flow was the following: (greeting from machine) -> "I want an appointment" -> (feedback from machine)-> "I want to meet with Vlad on Tuesday at 10PM" -> (properly going to Stage7) -> All good.
The next step in Stage2Listen (i.e. checking for just one entity of a specific category), was a bit trickier, I don't know why it was not understanding your guard, but I changed it and now it does recognize it. The flow is the following now: (greeting from machine) -> "I want an appointment" -> (feedback from machine)-> "I want to meet with Vlad" -> (properly going to Stage3) -> ...

You can follow the pattern I give you (which is, thankfully, much shorter than your guards haha) in the revised file and fix all the guard entities in the rest of the code so that it is perfect now (I cannot attach the file here, so you can download it from Canvas, lab 5).
You have done a good job in trying to make everything in one prompt. Send me the correction when you can so I can put a pass.

@ariageng
Copy link
Author

Hi Aya,

Thank you so much for the kind explanations! I've revised it referring to your example and I believe the program works smoothly now!
Happy Easter! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants