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

What is the time asks Wolfram: Expected - Only use Wolfram Alpha when Really Needed #1419

Open
mariobehling opened this issue Dec 16, 2019 · 5 comments
Labels

Comments

@mariobehling
Copy link
Member

mariobehling commented Dec 16, 2019

Currently susi_server tries to contact wolfram first before trying something else. A simple "what is the time" request takes seconds to complete:

2019-12-16 08:02:22.613 INFO root  - JSON data from API cannot be parsed: https://www.wolframcloud.com/objects/9611ca1b-5214-4887-863e-6ef6e4d44941
2019-12-16 08:02:22.613 INFO root  - Susi is thinking about: {"data":[],"metadata":{"hits":0,"count":0}}
2019-12-16 08:02:22.616 INFO root  - === Wasted 11393 milliseconds with intent {"id":-966673264,"depth":0,"score":9275070245451,"skill_source":"/susi_skill_data/models/general/Utilities/en/time.txt","skill_link":"https://github.com/fossasia/susi_skill_data/blob/master/models/general/Utilities/en/time.txt","skill_line":9,"keys":["time"],"phrases":[{"type":"minor","expression":"current time","line":9},{"type":"minor","expression":"what time is it","line":9},{"type":"minor","expression":"what time it is","line":9},{"type":"minor","expression":"what is the time","line":9},{"type":"minor","expression":"tell me the time","line":9},{"type":"minor","expression":"can you tell me the time","line":9},{"type":"minor","expression":"tell the time","line":9},{"type":"minor","expression":"what is the time","line":9},{"type":"minor","expression":"time now","line":9},{"type":"minor","expression":"could you tell me the time","line":9},{"type":"minor","expression":"i don't know what time it is","line":9},{"type":"minor","expression":"please tell the time","line":9}],"process":[{"type":"console","definition":{"url":"https://www.wolframcloud.com/objects/9611ca1b-5214-4887-863e-6ef6e4d44941","path":"$.queryresult.pods[1].subpods"}}],"actions":[{"type":"answer","select":"random","phrases":["It is $plaintext$"],"language":"en","line":17}],"cues":[],"example":"What time is it","expect":"it is 2 minutes past 17"}

Is there a way to disable wolfram or make it be contacted after local skills are nt found?

Related to: #1417

@norbusan
Copy link
Member

There are more problems here: Asking "what is the time" again queries Wolfram due to susi_skill_data/models/general/Utilities/en/time.txt, but the answer is broken, because the link given there responds with rubbish:

2020-01-12 16:42:39.843 INFO root  - JSON data from API cannot be parsed: https://www.wolframcloud.com/objects/9611ca1b-5214-4887-863e-6ef6e4d44941

At least the question about "what is the time in vienna" works, that is the second skill in the above file, and this API seems still to work.

@norbusan
Copy link
Member

I suggest to remove the first one, as it is completely irrelevant and done by internal os skill

Here is the skill

::name Time
::author Saurabh Jain
::author_url https://github.com/saurabhjn76
::description A skill to tell current time
::dynamic_content Yes
::developer_privacy_policy
::image images/time.png
::terms_of_use

current time | What time is it | What time it is|What is the time|tell me the time |can you tell me the time|tell the time|What's the time|time now|Could you tell me the time| I don't know what time it is| Please tell the time
!example:What time is it
!expect:it is 2 minutes past 17
!console:It is $plaintext$ 
{
"url":"https://www.wolframcloud.com/objects/9611ca1b-5214-4887-863e-6ef6e4d44941",
"path":"$.queryresult.pods[1].subpods"
}
eol

current time in * | What time is it in * ?| What time it is in * ?|What is the time in * ?|tell me the time in *| can you tell me the time in *| please tell the time in *| What's the time in *| time in *| Could you tell me the time in *| Could you please tell me the time in *
!example:current time in london
!console:In $1$ it is $plaintext$ 
{
"url":"https://api.wolframalpha.com/v2/query?input=what+time+is+it+in+$1$&format=plaintext&output=JSON&appid=9WA6XR-26EWTGEVTE",
"path":"$.queryresult.pods[1].subpods"
}
eol

@norbusan norbusan reopened this Jan 12, 2020
@norbusan
Copy link
Member

@Orbiter any comment concerning this?

@norbusan
Copy link
Member

Ok, I digged through the Java code, and in the case of "What is the time", two ideas are candidates:

  • /susi_skill_data/models/general/Utilities/en/time.txt which has score of 9275070245451 and asks Wolfram. The score computation is based on score = language=100, dialog=0, utterance=1, meatscore=8, wholesize=8, inference=1, subscore=10, pattern={"type":"minor","expression":"current time","line":9}

  • /susi_server.git/conf/os_skills/system/en/en_0200_facts_knowledge.json which has a score of 9273206754822 (less than the previous one). The score computation is based on score = language=100, dialog=0, utterance=1, meatscore=4, wholesize=4, inference=4, subscore=10, pattern={"type":"minor","expression":"what is the time"}

So I see there are two problems that need to be tackled

  • score computation for system skills should be considerably higher than user contributed skills
  • scores that need to query the internet should get a reduced score

Do we want to query wolfram on any question concerning "what is ..."? First of all, the appId/key needs to be configurable, and then, these queries take time.

@norbusan
Copy link
Member

I removed the wrong first entry from susi_skill_data/models/general/Utilities/en/time.txt since the URL gives errors. Now the susi server responds immediately with the time. Problem of timezone ignoring is still present, though.

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

No branches or pull requests

2 participants