Code Explanation - ChatGPT Cheat Sheet
explain this python code:
from deepsparse import Pipeline
qa_pipeline = Pipeline.create(task="question-answering")
inference = qa_pipeline(question="What's my name?", context="My name is Snorlax")
>> {'score': 0.9947717785835266, 'start': 11, 'end': 18, 'answer': 'Snorlax'}
explain this python code:
from deepsparse import Pipeline
qa_pipeline = Pipeline.create(task="question-answering")
inference = qa_pipeline(question="What's my name?", context="My name is Snorlax")
>> {'score': 0.9947717785835266, 'start': 11, 'end': 18, 'answer': 'Snorlax'}
👍2
Docstrings Generation - ChatGPT Cheat Sheet
write a docstring description for this function:
import requests
def make_get_request(url):
response = requests.get(url)
return response.status_code, response.text
make_get_request('https://www.example.com')
write a docstring description for this function:
import requests
def make_get_request(url):
response = requests.get(url)
return response.status_code, response.text
make_get_request('https://www.example.com')
👍1
Data Object Conversions (JSON, XML, CSV etc.) - ChatGPT Cheat Sheet
convert this JSON object into XML:
{"Name":{"0":"John Smith","1":"Jane Doe","2":"Bob Johnson","3":"Samantha Williams"},"Age":{"0":32,"1":28,"2":45,"3":40},"Gender":{"0":"Male","1":"Female","2":"Male","3":"Female"},"O ccupation":{"0":"Software Developer","1":"Data Analyst","2":"Project Manager","3":"Marketing Director"}}
convert this JSON object into XML:
{"Name":{"0":"John Smith","1":"Jane Doe","2":"Bob Johnson","3":"Samantha Williams"},"Age":{"0":32,"1":28,"2":45,"3":40},"Gender":{"0":"Male","1":"Female","2":"Male","3":"Female"},"O ccupation":{"0":"Software Developer","1":"Data Analyst","2":"Project Manager","3":"Marketing Director"}}
👍1
Knowledge Graph Generation - ChatGPT Cheat Sheet
convert this text into nodes and edges: Babe Ruth joined the New York Yankees in 1920. The Boston Red Sox sold his contract to the Yankees. He played for the Yankees from 1920 to 1934, and during that time he established himself as one of the greatest players in baseball history.
convert this text into nodes and edges: Babe Ruth joined the New York Yankees in 1920. The Boston Red Sox sold his contract to the Yankees. He played for the Yankees from 1920 to 1934, and during that time he established himself as one of the greatest players in baseball history.
👍4
Headings and Subheadings - ChatGPT Cheat Sheet
convert this text into headings and subheadings: Babe Ruth joined the New York Yankees in 1920. The Boston Red Sox sold his contract to the Yankees. He played for the Yankees from 1920 to 1934, and during that time he established himself as one of the greatest players in baseball history.
convert this text into headings and subheadings: Babe Ruth joined the New York Yankees in 1920. The Boston Red Sox sold his contract to the Yankees. He played for the Yankees from 1920 to 1934, and during that time he established himself as one of the greatest players in baseball history.
👍1