Neuralfinity

Magic-Summary: Python Demo

1 min read

Author: Jannik Malte Meissner

Magic-Summary: Python Demo

Always wanted to know how to quickly summarise text using Python, or any other programming language? In this video, we are sharing with you how easily and quickly the GraphQL Magic-Summary API can be integrated in your Python back-end code.  Magic-Summary is the first model available via Neuralfinity's Computational Magic in practice!

Intrigued? Then sign up for the waitlist to get access to Magic-Summary.

No matter if you want to summarise product descriptions for an online shop, legal documents or news articles, our API is easy to use and integrate and can deliver the results you need - in minutes. And on top, it is 100% GDPR compliant and requires no data from your side for fine tuning. We build our own, state of the art transformer based large language model that is optimised to perform on a wide variarity  of contents. And since we use a GraphQL API, you can build your app in any programming language you want to use, with no native SDKs required to get to your destination.

import requests

def main():
   	url = "https://magicsummary.p.rapidapi.com/api/v1"
   
    string = """YOUR LONG STRING GOES HERE"""
    
    query = "{\"query\":\"{summary(input: \\\" " + string + "\\\" )}\"}"
    

    headers = {
    	'content-type': "application/json",
    	'x-rapidapi-host': "magicsummary.p.rapidapi.com",
 	  	'x-rapidapi-key': "NEVER_SHARE_YOUR_KEY"
        }

   
    response = requests.request("POST", url=url, data=query, headers=headers)

    print(response.text)

if __name__ == "__main__":
    main()

For more information, have a look at the Computational Magic page and the documentation.