CurryMindFree commited on
Commit
4986b8a
·
verified ·
1 Parent(s): 57195b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -63,7 +63,7 @@ with gr.Blocks() as demo:
63
  gr.Markdown("""# Enter anything and press Enter""")
64
 
65
  topic_input = gr.Textbox(
66
- label="Enter anything"
67
  )
68
 
69
  output = gr.Textbox(
@@ -77,16 +77,18 @@ with gr.Blocks() as demo:
77
  )
78
 
79
  gr.Markdown("""
80
- # How it works:
81
 
82
- - **Dataset: 500 news plus 3 news of myown**
83
- - **Embedding model: bge-small-en-v1.5**
84
- - **FAISS**
85
- - **Sum(above)=Vector database and retrieval**
 
 
86
 
87
 
88
 
89
- **To add a little fun, I made 3 news.:**
90
  - **ID500: Basketball player LeBron James jioned 76er with a 5m/year contract.**
91
  - **ID501: Spain won 2026 Football World Cup, defeating Argentina at final.**
92
  - **ID502: Baseball player Shohei Ohtani plays as a hitter and as a pitcher, a rare two-way player.**
 
63
  gr.Markdown("""# Enter anything and press Enter""")
64
 
65
  topic_input = gr.Textbox(
66
+ label="Enter here"
67
  )
68
 
69
  output = gr.Textbox(
 
77
  )
78
 
79
  gr.Markdown("""
80
+ # Workflow:
81
 
82
+ - **Data pipeline. Get 500 news from ag_news dataset, and truncate each news to 130 characters**
83
+ - **Model BAAI/bge-v1.5 embeds the dataset and user input into vectors**
84
+ - **FAISS computes the semantic similarity between user-input-vector and each vector else**
85
+ - **Retrieve the top3 most relevant news based on semantic similarity, and show them to user**
86
+ - **Added custom news to test the retrieved results and make sure everything works**
87
+ - **Deploy UI**
88
 
89
 
90
 
91
+ **To test and have some fun, I made 3 news.:**
92
  - **ID500: Basketball player LeBron James jioned 76er with a 5m/year contract.**
93
  - **ID501: Spain won 2026 Football World Cup, defeating Argentina at final.**
94
  - **ID502: Baseball player Shohei Ohtani plays as a hitter and as a pitcher, a rare two-way player.**