File size: 531 Bytes
9f4286b
 
44622dc
 
 
 
9f4286b
 
80fc9d7
dcfbe98
ac4be15
dcfbe98
9f4286b
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)
    ress = "CCL=" + str(res["loc_coh_ccl"][0])
    return ress



gradio_app = gr.Interface(
    caller,
    inputs=["text","text"],
    outputs="text",
    title="Local Coherence Scorer (CCL)",
)


if __name__ == "__main__":
    gradio_app.launch()