yuntian-deng's picture
Update app.py
b8e2db5 verified
raw
history blame
2.69 kB
import gradio as gr
import json
# Load your validation set
#with open('validation_data.json', 'r') as file:
# validation_data = json.load(file)
def predict(title, authors, abstract):
# Your model prediction logic here
score = 0.5 #model_inference(title, authors, abstract) # Replace this with your actual model inference
# Calculate precision for scores >= the predicted score
#selected = [d for d in validation_data if d['score'] >= score]
#true_positives = sum(1 for d in selected if d['label'] == 1)
#precision = true_positives / len(selected) if selected else 0
precision = 0.2
result = f"For papers with a score greater than or equal to {score:.2f}, approximately {precision * 100:.2f}% are selected by AK."
return score, result
iface = gr.Interface(
fn=predict,
inputs=["text", "text", "text_area"],
outputs=[gr.outputs.Textbox(label="Predicted Score"), gr.outputs.Textbox(label="Resulting Probability")],
examples=[["WildChat: 1M ChatGPT Interaction Logs in the Wild", "Wenting Zhao, Xiang Ren, Jack Hessel, Claire Cardie, Yejin Choi, Yuntian Deng", "Chatbots such as GPT-4 and ChatGPT are now serving millions of users. Despite their widespread use, there remains a lack of public datasets showcasing how these tools are used by a population of users in practice. To bridge this gap, we offered free access to ChatGPT for online users in exchange for their affirmative, consensual opt-in to anonymously collect their chat transcripts and request headers. From this, we compiled WildChat, a corpus of 1 million user-ChatGPT conversations, which consists of over 2.5 million interaction turns. We compare WildChat with other popular user-chatbot interaction datasets, and find that our dataset offers the most diverse user prompts, contains the largest number of languages, and presents the richest variety of potentially toxic use-cases for researchers to study. In addition to timestamped chat transcripts, we enrich the dataset with demographic data, including state, country, and hashed IP addresses, alongside request headers. This augmentation allows for more detailed analysis of user behaviors across different geographical regions and temporal dimensions. Finally, because it captures a broad range of use cases, we demonstrate the dataset’s potential utility in fine-tuning instruction-following models. WildChat is released at https://wildchat.allen.ai under AI2 ImpACT Licenses."]],
title="Will your paper be selected by @_akhaliq?",
description="Enter the title, authors, and abstract of the paper to predict whether @_akhaliq will select your paper!",
live=True
)
iface.launch()