Spaces:
Sleeping
Sleeping
# Function to check if the uploaded file has the expected columns | |
def check_columns(df): | |
if set(df.columns) == set(["text", "label"]): | |
return True | |
else: | |
return False | |
# Function to calculate the number of instances of each label class | |
def count_labels(df): | |
counts = df["label"].value_counts() | |
return counts.to_dict() | |