Movatterモバイル変換


[0]ホーム

URL:


Open In App
Next Article:
Voice Assistant using python
Next article icon
TheWolfram|Alpha Webservice API provides a web-based API allowing the computational and presentation capabilities of Wolfram|Alpha to be integrated into web, mobile, desktop, and enterprise applications.Wolfram Alpha is an API which can compute expert-level answers using Wolfram’s algorithms, knowledgebase and AI technology. It is made possible by the Wolfram Language. This article tells how to create a simple assistant application in Python which can answer simple questions like the ones listed below.
Input : What is the capital of India? Output : New DelhiInput : What is sin(30)?Output : 0.5
Prerequisite: Basic understanding of
pythonsyntax and functions.Getting API Id
  1. Create a account at Wolfram alpha. The account can be created atthe official website.
  2. After signing up, sign in using your Wolfram ID.
  3. Now you will see the homepage of the website. Head to the section in the top right corner where you see your email. In the drop down menu, select the My Apps (API) option.
  4. Click the Get an AppID button to get the id.
  5. In the next dialog box, give the app a suitable name and description.
  6. Note down the APPID that appears in the next dialog box. This app id will be specific to the application.
ImplementationMake sure thatwolframalpha python package is installed beforehand. It can be done by running the following command in the terminal or cmd -
pip install wolframalpha
Below is the implementationPython3 1==
# Python program to# demonstrate creation of an# assistant using wolf ram APIimportwolframalpha# Taking input from userquestion=input('Question: ')# App id obtained by the above stepsapp_id=Yourapp_id# Instance of wolf ram alpha# client classclient=wolframalpha.Client(app_id)# Stores the response from# wolf ram alphares=client.query(question)# Includes only text from the responseanswer=next(res.results).textprint(answer)
Output:

Improve
Practice Tags :

Similar Reads

We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood ourCookie Policy &Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences

[8]ページ先頭

©2009-2025 Movatter.jp