Spaces:
Sleeping
Sleeping
import gradio as gr | |
import evaluate | |
from evaluate.utils import launch_gradio_widget | |
def caller(text,dataset="pubmed"): | |
metric = evaluate.load("ronaldahmed/ccl_win") | |
res = metric.compute(predictions=[text],dataset=dataset,use_aggregator=False,device="cpu",batch_size=16) | |
total = len(res["loc_coh_ccl"]) | |
results = [{"coh_ccl_window":res["loc_coh_ccl"][i]} for i in range(total)] | |
ress = "CCL=" + str(results[0]) | |
return ress | |
gradio_app = gr.Interface( | |
caller, | |
inputs=["text","text"], | |
outputs="text", | |
title="Local Coherence Scorer (CCL)", | |
) | |
if __name__ == "__main__": | |
gradio_app.launch() |