polinaeterna HF staff commited on
Commit
406f549
·
verified ·
1 Parent(s): 73b419e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -49,7 +49,9 @@ def run_quality_check(dataset, column, n_samples):
49
  data = pl.read_parquet(f"hf://datasets/{dataset}@~parquet/{config}/train/0000.parquet", columns=[column])
50
  texts = data[column].to_list()
51
  predictions = predict(texts[:n_samples])
52
- return pd.DataFrame({"quality": predictions})
 
 
53
 
54
 
55
  with gr.Blocks() as demo:
 
49
  data = pl.read_parquet(f"hf://datasets/{dataset}@~parquet/{config}/train/0000.parquet", columns=[column])
50
  texts = data[column].to_list()
51
  predictions = predict(texts[:n_samples])
52
+ counts = pd.DataFrame({"quality": predictions}).value_counts().to_frame()
53
+ counts.reset_index(inplace=True)
54
+ return counts
55
 
56
 
57
  with gr.Blocks() as demo: