ccl_win / app.py
ronaldahmed's picture
Update app.py
80fc9d7 verified
raw
history blame
641 Bytes
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=preds,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)]
res = "CCL per sample=" + str(results)
return res
gradio_app = gr.Interface(
caller,
inputs=["text","text"],
outputs="text",
title="Local Coherence Scorer (CCL)",
)
if __name__ == "__main__":
gradio_app.launch()