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

[BUG] Intent builder adds a space before TP parts that start with an apostrophe when adding a new TP #114

Closed
frrleone opened this issue Mar 2, 2023 · 2 comments · Fixed by #113
Assignees
Labels
bug Something isn't working

Comments

@frrleone
Copy link

frrleone commented Mar 2, 2023

When using the intent builder to add a new training phrase as the one shown below, the builder adds a space between the annotated part and the following part whose text starts with the possessive "'s":

"phone's not working" where "phone" is annotated with ProvidedProductLine

Expected Behavior

Adding the tp as follows:
intent_builder.add_training_phrase(["phone", "'s not working"], ["ProvidedProductLine", ""])

should result in a tp "phone's not working" where "phone" is annotated with ProvidedProductLine

Current Behavior

Adding the tp as follows:
intent_builder.add_training_phrase(["phone", "'s not working"], ["ProvidedProductLine", ""])

results in a tp "phone 's not working" where "phone" is annotated with ProvidedProductLine

Possible Solution

Check if a part starts with the possessive "'s", and, if it does, do not add a space before it. This may be true in other situations as well, for example "," and "?" (these may already be accounted for, I haven't seen them, just a thought.)

@frrleone frrleone added the bug Something isn't working label Mar 2, 2023
@MRyderOC MRyderOC self-assigned this Mar 2, 2023
@MRyderOC
Copy link
Collaborator

MRyderOC commented Mar 2, 2023

@frrleone Great catch. For now this method does not take into account any special character to decide whether to add spaces or not.
Can you provide an example training phrase that includes "," and "?" ?
@kmaphoenix any other characters we should be concerned about?

@MRyderOC MRyderOC linked a pull request Mar 3, 2023 that will close this issue
@kmaphoenix
Copy link
Member

@MRyderOC Perhaps we should check all ending punctuation: ., !, ?

I think ', , should cover the majority of other cases.

MRyderOC added a commit that referenced this issue Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants