Spaces:
Runtime error
Runtime error
new datasets
Browse files
app.py
CHANGED
@@ -2,19 +2,24 @@ import gradio as gr
|
|
2 |
import argilla as rg
|
3 |
import os
|
4 |
|
5 |
-
from argilla._constants import DEFAULT_API_KEY
|
6 |
from datasets import load_dataset
|
7 |
|
8 |
dataset = load_dataset("dvilasuero/banking_app", split="train").shuffle()
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
# or
|
14 |
-
dataset_rg = rg.DatasetForTextClassification.from_datasets(my_dataset)
|
15 |
-
|
16 |
-
# export back to a datasets
|
17 |
-
dataset_rg.to_datasets()
|
18 |
|
19 |
def greet(name):
|
20 |
return "Hello " + name + "!!"
|
|
|
2 |
import argilla as rg
|
3 |
import os
|
4 |
|
|
|
5 |
from datasets import load_dataset
|
6 |
|
7 |
dataset = load_dataset("dvilasuero/banking_app", split="train").shuffle()
|
8 |
+
# You can find your Space URL behind the Embed this space button
|
9 |
+
# Change it
|
10 |
+
rg.init(
|
11 |
+
api_url="https://ravi259-sml-argilla.hf.space",
|
12 |
+
api_key="admin.apikey"
|
13 |
+
)
|
14 |
+
banking_ds = load_dataset("argilla/banking_sentiment_setfit", split="train")
|
15 |
+
# Argilla expects labels in the annotation column
|
16 |
+
# We include labels for demo purposes
|
17 |
+
banking_ds = banking_ds.rename_column("label", "annotation")
|
18 |
+
# Build argilla dataset from datasets
|
19 |
+
argilla_ds = rg.read_datasets(banking_ds, task="TextClassification")
|
20 |
|
21 |
+
# Create dataset
|
22 |
+
rg.log(argilla_ds, "bankingapp_sentiment")
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
def greet(name):
|
25 |
return "Hello " + name + "!!"
|