Skip to content

adds option to add external information sources like model callbacks #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

jhoetter
Copy link
Member

No description provided.

@jhoetter
Copy link
Member Author

Run this together with:

You can add a model callback using the Python SDK in branch external-information-sources (PR) as follows:

from refinery import Client

user_name = "your-mail" # this is the email you log in with
password = "your-pw"
project_id = "your-clickbait-sample-project-id" # can be found in the URL of the web application

client = Client(user_name, password, project_id, uri="http://localhost:4455")

from sklearn.linear_model import LogisticRegression
clf = LogisticRegression()

from refinery.adapter.sklearn import build_classification_dataset
data = build_classification_dataset(client, "headline", "__clickbait", "distilbert-base-uncased", num_train=50)
clf.fit(data["train"]["inputs"], data["train"]["labels"])

from refinery.callbacks.sklearn import SklearnCallback
callback = SklearnCallback(
    client, 
    clf,
    "clickbait", 
)

callback.run(data["train"]["inputs"], data["train"]["index"])
callback.run(data["test"]["inputs"], data["test"]["index"])

@jhoetter jhoetter marked this pull request as ready for review September 13, 2022 10:04
@jhoetter jhoetter requested a review from JWittmeyer September 13, 2022 10:04
@jhoetter jhoetter merged commit 136bda3 into dev Sep 13, 2022
@jhoetter jhoetter deleted the external-information-sources branch September 13, 2022 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants