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

Results information #294

Open
OmriBenShoham opened this issue May 20, 2024 · 1 comment
Open

Results information #294

OmriBenShoham opened this issue May 20, 2024 · 1 comment

Comments

@OmriBenShoham
Copy link
Contributor

I am using the semantic route and I am missing the results explanation.
If the threshold is passed/not-passed I expect that it will return the utterances score results, so I could understand how the Route utterances effected the results.

Currently as a result I get the RouteChoice object, but I can't find any relevant information except the name of the Route which does not help me understand the utterances scores.

Code example(I used your example):

politics = Route(
    name="politics",
    utterances=[
        "isn't politics the best thing ever",
        "why don't you tell me about your political opinions",
        "don't you just love the president",
        "they're going to destroy this country!",
        "they will save the country!",
    ],
)

# this could be used as an indicator to our chatbot to switch to a more
# conversational prompt
chitchat = Route(
    name="chitchat",
    utterances=[
        "how's the weather today?",
        "how are things going?",
        "lovely weather today",
        "the weather is horrendous",
        "let's go to the chippy",
    ],
)

# we place both of our decisions together into single list
routes = [politics, chitchat]

from semantic_router.layer import RouteLayer

rl = RouteLayer(encoder=encoder, routes=routes)
result = rl("don't you love politics?")

In this case the result will show politics, and I expect it to explain based on which of the utterances the decision done.

Is there any way I can retrieve this information?and if not is there any planning to implement this?

@GalDayan
Copy link
Contributor

GalDayan commented May 21, 2024

👍 Same here

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

No branches or pull requests

2 participants