KB-VQA-E / my_model /tabs /results.py
m7mdal7aj's picture
Update my_model/tabs/results.py
bd62fcd verified
raw
history blame
1.64 kB
import pandas as pd
from fuzzywuzzy import fuzz
from collections import Counter
from nltk.stem import PorterStemmer
from ast import literal_eval
from typing import Union, List
import streamlit as st
from my_model.results.evaluation import KBVQAEvaluator
class ResultDemonstrator(KBVQAEvaluator):
def run(self):
import pandas as pd
import altair as alt
# Sample data
data = pd.DataFrame({
'x': range(10),
'y': [2, 1, 4, 3, 5, 6, 9, 7, 10, 8]
})
# Create a scatter plot
chart = alt.Chart(data).mark_point().encode(
x='x',
y='y'
)
# Display the chart in Streamlit
st.altair_chart(chart, use_container_width=True)
# Display the chart in Streamlit
st.altair_chart(chart, use_container_width=True)
import matplotlib.pyplot as plt
import numpy as np
# Data
x = np.random.randn(100)
y = np.random.randn(100)
# Create a scatter plot
fig, ax = plt.subplots()
ax.scatter(x, y)
# Display the plot in Streamlit
st.pyplot(fig)
import plotly.express as px
# Data
df = pd.DataFrame({
"x": range(10),
"y": [2, 1, 4, 3, 5, 6, 9, 7, 10, 8],
"color": ["red"] * 5 + ["blue"] * 5
})
# Create an interactive scatter plot
fig = px.scatter(df, x='x', y='y', color='color')
# Display the plot in Streamlit
st.plotly_chart(fig)