How To Build A Scam Token Detector Using Python and OpenAI

By akohad Jan29,2023

[ad_1]

Photo by Alex Chumak on Unsplash
import requests

url = "https://api.binance.com/api/v3/ticker/price"
response = requests.get(url)
data = response.json()

print(data)

from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(data, labels, test_size=0.2)

clf = DecisionTreeClassifier()
clf.fit(X_train, y_train)

import openai_secret_manager

# Get API key
secrets = openai_secret_manager.get_secrets("openai")
api_key = secrets["api_key"]

# Fine-tune model
model_engine = "text-davinci-002"
prompt = (f"Fine-tune a decision tree classifier on new data")

completions = openai.Completion.create(
engine=model_engine,
prompt=prompt,
temperature=0.7,
max_tokens=1024,
n=1,
stop=None,
temperature=0.5,
)

message = completions.choices[0].text
print(message)

[ad_2]

Source link

By akohad

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *