Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 Excel Semantic Search

A Streamlit-based web app that lets you search inside Excel or CSV files semantically — not just by exact keywords. It uses SentenceTransformer embeddings to understand the meaning of your query and find similar rows, even if the words are different.


🧠 What this app does

This tool helps you explore tabular data in a more human-like way. Instead of typing exact terms, you can describe what you’re looking for in natural language, and the app will retrieve conceptually related entries.

For example:

Searching for “solar energy materials” might return rows describing “photovoltaic systems for desert environments” or “nanostructured catalysts for hydrogen production.”


🚀 Key Features

  • Upload .xlsx or .csv files directly.
  • Choose the column to index and search semantically.
  • Add contextual columns to show in the results.
  • Adjust similarity threshold and number of results.
  • Uses multilingual model paraphrase-multilingual-MiniLM-L12-v2.
  • Download the results as a CSV file.
  • Works fully offline once the model is downloaded.

⚙️ Installation (recommended with Conda)

You can easily run this project on Python 3.11.

1. Clone the repository

git clone https://github.com/<your-username>/excel-semantic-search.git
cd excel-semantic-search

2. Create and activate a conda environment

conda create -n excelsearch python=3.11
conda activate excelsearch

🧩 Dependencies

You can install the dependencies using pip or conda.

📦 Option 1 — requirements.txt

Install using pip:

pip install -r requirements.txt

requirements.txt:

streamlit>=1.37.0
pandas>=2.2.0
numpy>=1.26.0
sentence-transformers>=2.7.0
scikit-learn>=1.5.0
openpyxl>=3.1.2

Explanation:

  • streamlit → runs the web interface
  • pandas, numpy → handle tabular data
  • sentence-transformers → generate semantic embeddings
  • scikit-learn → compute cosine similarity
  • openpyxl → required to read .xlsx files

🧬 Option 2 — environment.yml

You can also create the full conda environment in one command:

name: excelsearch
channels:
  - conda-forge
dependencies:
  - python=3.11
  - pip
  - pip:
      - streamlit>=1.37.0
      - pandas>=2.2.0
      - numpy>=1.26.0
      - sentence-transformers>=2.7.0
      - scikit-learn>=1.5.0
      - openpyxl>=3.1.2

Create and activate it:

conda env create -f environment.yml
conda activate excelsearch

▶️ How to Run

Once the environment is ready, launch the Streamlit app:

streamlit run app.py

Then open the link that appears in your terminal (usually http://localhost:8501).


🧩 How It Works

  1. The app loads your Excel/CSV file into a DataFrame.
  2. You select which column contains the text you want to search.
  3. Each entry in that column is converted into an embedding vector using a pretrained SentenceTransformer model.
  4. When you type a query, it is embedded as well.
  5. The app computes the cosine similarity between your query and all rows.
  6. Results are sorted by similarity and filtered by a threshold you can adjust interactively.

💡 Example Use Cases

  • Searching project descriptions or grant proposals.
  • Exploring survey responses semantically.
  • Finding related abstracts, titles, or keywords.
  • Comparing textual fields across large datasets.

🧰 Tech Stack


⚡ Quick Start

For the fastest setup:

git clone https://github.com/<your-username>/excel-semantic-search.git
cd excel-semantic-search
conda env create -f environment.yml
conda activate excelsearch
streamlit run app.py

📊 Example Data

An example dataset (example_data.csv) is included in this repository for testing and demonstration purposes. All data — including researcher names and project descriptions — are fictional and were synthetically generated to illustrate semantic search behavior.

🧪 The only real researcher included is Antonio Alvarez, whose authentic work can be reviewed here: 🔗 GitHub – antadlp/rms-aot-methanol

This dataset is safe to use for teaching, experimentation, and public demos.


📄 License

This project is released under the MIT License — free to use, modify, and share with attribution.


Would you like me to integrate this paragraph directly into the full README (so you have the final consolidated version in one file, ready to upload)?


📦 Future Improvements

  • Add support for FAISS-based search for faster performance on large datasets.
  • Enable multi-column semantic fusion (search across several text fields).
  • Add GPU detection for automatic acceleration.

📄 License

This project is released under the MIT License — free to use, modify, and share with attribution.


About

A Streamlit app for semantic search in Excel or CSV files using multilingual sentence embeddings.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages