abdullahmubeen10 commited on
Commit
7d949b4
·
verified ·
1 Parent(s): 00035e6

Update Demo.py

Browse files
Files changed (1) hide show
  1. Demo.py +5 -2
Demo.py CHANGED
@@ -70,7 +70,11 @@ def fit_data(pipeline, json_data, question):
70
  spark_df = spark.createDataFrame([[json_data, question]]).toDF("table_json", "questions")
71
  model = pipeline.fit(spark_df)
72
  result = model.transform(spark_df)
73
- return str(result.select("answers_wtq.result", "answers_sqa.result"))
 
 
 
 
74
 
75
  # Sidebar content
76
  model = st.sidebar.selectbox(
@@ -172,7 +176,6 @@ output = fit_data(pipeline, table_json_str, text_to_analyze)
172
  st.markdown("---")
173
  st.subheader("Processed Output")
174
 
175
- output
176
  # # Check if output is available
177
  # if output:
178
  # results_wtq = output[0][0] if output[0][0] else "No results found."
 
70
  spark_df = spark.createDataFrame([[json_data, question]]).toDF("table_json", "questions")
71
  model = pipeline.fit(spark_df)
72
  result = model.transform(spark_df)
73
+
74
+ lia= result.select("answers_wtq.result", "answers_sqa.result").tolist()
75
+ lia
76
+ pan = result.select("answers_wtq.result", "answers_sqa.result").toPandas()
77
+ pan
78
 
79
  # Sidebar content
80
  model = st.sidebar.selectbox(
 
176
  st.markdown("---")
177
  st.subheader("Processed Output")
178
 
 
179
  # # Check if output is available
180
  # if output:
181
  # results_wtq = output[0][0] if output[0][0] else "No results found."