GPT Summarization

FREEMIUM
By OpenedAI | Updated 5 days ago | Text Analysis
Popularity

9 / 10

Latency

43,288ms

Service Level

100%

Health Check

N/A

Back to All Tutorials (1)

Common mistakes & Example call

Here are some common mistakes when calling the API:

  • Your text is not valid json. Especially if you use the RapidAPI interface you must remove or escape invalid characters such as " with a \. Refer to the Python implementation below to do so automatically with the json package. This accounts for 99% of all <BadRequest ‘400: Bad Request’> errors.

  • Your text is shorter than num_sentences requested. This will still work, but the model will obviously produce a bad summary.

Here is an example for correctly calling the API in Python:

import requests
import json

url = "https://gpt-summarization.p.rapidapi.com/summarize"

text = """Generative Pre-trained Transformer 3 (GPT-3) is an autoregressive language model that uses deep learning to produce human-like text. It is the third-generation language prediction model in the GPT-n series (and the successor to GPT-2) created by OpenAI, a San Francisco-based artificial intelligence research laboratory.[2] GPT-3's full version has a capacity of 175 billion machine learning parameters. GPT-3, which was introduced in May 2020, and was in beta testing as of July 2020,[3] is part of a trend in natural language processing (NLP) systems of pre-trained language representations.[1] Before the release of GPT-3, the largest language model was Microsoft's Turing NLG, introduced in February 2020, with a capacity of 17 billion parameters or less than a tenth of GPT-3s.[4]

The quality of the text generated by GPT-3 is so high that it is difficult to distinguish from that written by a human, which has both benefits and risks.[4] Thirty-one OpenAI researchers and engineers presented the original May 28, 2020 paper introducing GPT-3. In their paper, they warned of GPT-3's potential dangers and called for research to mitigate risk.[1]:34 David Chalmers, an Australian philosopher, described GPT-3 as "one of the most interesting and important AI systems ever produced."[5]

Microsoft announced on September 22, 2020 that it had licensed "exclusive" use of GPT-3; others can still use the public API to receive output, but only Microsoft has control of the source code.[6]


According to The Economist, improved algorithms, powerful computers, and an increase in digitized data have fueled a revolution in machine learning, with new techniques in the 2010s resulting in "rapid improvements in tasks" including manipulating language.[7] Software models are trained to learn by using thousands or millions of examples in a "structure ... loosely based on the neural architecture of the brain".[7] One architecture used in natural language processing (NLP) is a neural network based on a deep learning model that was first introduced in 2017—the Transformer.[8] GPT-n models are based on this Transformer-based deep learning neural network architecture. There are a number of NLP systems capable of processing, mining, organizing, connecting, contrasting, understanding and generating answers to questions.[9]

On June 11, 2018, OpenAI researchers and engineers posted their original paper on generative models—language models—artificial intelligence systems—that could be pre-trained with an enormous and diverse corpus of text via datasets, in a process they called generative pre-training (GP).[10] The authors described how language understanding performances in natural language processing (NLP) were improved in GPT-n through a process of "generative pre-training of a language model on a diverse corpus of unlabeled text, followed by discriminative fine-tuning on each specific task." This eliminated the need for human supervision and for time-intensive hand-labeling.[10]

In February 2020, Microsoft introduced its Turing Natural Language Generation (T-NLG), which was then the "largest language model ever published at 17 billion parameters."[11] It performed better than any other language model at a variety of tasks which included summarizing texts and answering questions.[11]


On May 28, 2020, an arXiv preprint by a group of 31 engineers and researchers at OpenAI described the development of GPT-3, a third-generation "state-of-the-art language model".[1][4] The team increased the capacity of GPT-3 by over two orders of magnitude from that of its predecessor, GPT-2,[12] making GPT-3 the largest non-sparse[further explanation needed] language model to date.[1]:14[2] GPT-3's higher number of parameters grants it a higher level of accuracy relative to previous versions with smaller capacity.[13] GPT-3's capacity is ten times larger than that of Microsoft's Turing NLG.[4]

Sixty percent of the weighted pre-training dataset for GPT-3 comes from a filtered version of Common Crawl consisting of 410 billion byte-pair-encoded tokens.[1]:9 Other sources are 19 billion tokens from WebText2 representing 22% of the weighted total, 12 billion tokens from Books1 representing 8%, 55 billion tokens from Books2 representing 8%, and 3 billion tokens from Wikipedia representing 3%.[1]:9 GPT-3 was trained on hundreds of billions of words and is capable of coding in CSS, JSX, Python, among others.[3] Since GPT-3's training data was all-encompassing, it does not require further training for distinct language tasks.[3]

On June 11, 2020, OpenAI announced that users could request access to its user-friendly GPT-3 API—a "machine learning toolset"—to help OpenAI "explore the strengths and limits" of this new technology.[14][15] The invitation described how this API had a general-purpose "text in, text out" interface that can complete almost "any English language task", instead of the usual single use-case.[14] According to one user, who had access to a private early release of the OpenAI GPT-3 API, GPT-3 was "eerily good" at writing "amazingly coherent text" with only a few simple prompts.[16]

Because GPT-3 can "generate news articles which human evaluators have difficulty distinguishing from articles written by humans,"[4] GPT-3 has the "potential to advance both the beneficial and harmful applications of language models."[1]:34 In their May 28, 2020 paper, the researchers described in detail the potential "harmful effects of GPT-3"[4] which include "misinformation, spam, phishing, abuse of legal and governmental processes, fraudulent academic essay writing and social engineering pretexting".[1] The authors draw attention to these dangers to call for research on risk mitigation.[1]:34

The machine learning computer program uses one-shot learning.[17]


In his July 29, 2020, review in The New York Times, Farhad Manjoo said that GPT-3—which can generate computer code and poetry, as well as prose—is not just "amazing", "spooky", and "humbling", but also "more than a little terrifying".[18]

Daily Nous presented a series of articles by nine philosophers on GPT-3.[19] Australian philosopher David Chalmers described GPT-3 as "one of the most interesting and important AI systems ever produced".[5]

A review in Wired said that GPT-3 was "provoking chills across Silicon Valley".[20]

The National Law Review said that GPT-3 is an "impressive step in the larger process", with OpenAI and others finding "useful applications for all of this power" while continuing to "work toward a more general intelligence".[21]

An article in the MIT Technology Review, cowritten by Deep Learning critic Gary Marcus,[22] stated that GPT-3's "comprehension of the world is often seriously off, which means you can never really trust what it says."[23] According to the authors, GPT-3 models relationships between words without having an understanding of the meaning behind each word.

Jerome Pesenti, head of the Facebook A.I. lab, said GPT-3 is "unsafe," pointing to the sexist, racist and other biased and negative language generated by the system when it was asked to discuss Jews, women, black people, and the Holocaust.[24]
Nabla, a French start-up specialized in healthcare technology, tested GPT-3 as medical chatbot, though OpenAI itself warned against such use. As expected, GPT-3 showed several limitations. For example, while testing GPT-3 responses about mental health issues, the AI advised a simulated patient to commit suicide.[25]
GPT-3 has been used by Andrew Mayne for AI Writer,[26] which allows people to correspond with historical figures via email.
GPT-3 has been used by Jason Rohrer in a retro-themed chatbot project named "Project December", which is accessible online and allows users to converse with several AIs using GPT-3 technology.
GPT-3 was used by The Guardian to write an article about AI being harmless to human beings. It was fed some ideas and produced eight different essays, which were ultimately merged into one article.[27]
GPT-3 is used in AI Dungeon, which generates text-based adventure games.
"""

payload = {"text": text, "num_sentences": 3}
payload = json.dumps(payload)

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

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

print(response.text)