|
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 |
|
|
|
|
|
data = pd.DataFrame({ |
|
'x': range(10), |
|
'y': [2, 1, 4, 3, 5, 6, 9, 7, 10, 8] |
|
}) |
|
|
|
|
|
chart = alt.Chart(data).mark_point().encode( |
|
x='x', |
|
y='y' |
|
) |
|
|
|
|
|
st.altair_chart(chart, use_container_width=True) |
|
|
|
st.altair_chart(chart, use_container_width=True) |
|
|
|
import matplotlib.pyplot as plt |
|
import numpy as np |
|
|
|
|
|
x = np.random.randn(100) |
|
y = np.random.randn(100) |
|
|
|
|
|
fig, ax = plt.subplots() |
|
ax.scatter(x, y) |
|
|
|
|
|
st.pyplot(fig) |
|
|
|
import plotly.express as px |
|
|
|
|
|
|
|
df = pd.DataFrame({ |
|
"x": range(10), |
|
"y": [2, 1, 4, 3, 5, 6, 9, 7, 10, 8], |
|
"color": ["red"] * 5 + ["blue"] * 5 |
|
}) |
|
|
|
|
|
fig = px.scatter(df, x='x', y='y', color='color') |
|
|
|
|
|
st.plotly_chart(fig) |
|
|