The Eco-Friendly Fabric Recommendation System helps users discover sustainable and eco-friendly fabric alternatives. By selecting a fabric, the system suggests similar options using advanced similarity search algorithms powered by FAISS (Facebook AI Similarity Search) and TF-IDF. The application features an interactive UI built with Streamlit.
This project is part of the Eco-Friendly Tribe initiative, which aims to promote sustainable fabric choices.
- Interactive Fabric Selection: Users can select a fabric to find similar eco-friendly alternatives.
- Text Vectorization: Leverages TF-IDF to analyze fabric titles and descriptions.
- Categorical Encoding: Encodes categorical labels using one-hot encoding for enhanced similarity search.
- FAISS Integration: Employs FAISS for fast and accurate similarity search.
- Streamlit Frontend: Provides a simple and user-friendly interface.
The system uses the FabricFrontiers dataset. This dataset contains the following fields:
idx
: Unique identifier for each fabric.title
: Name of the fabric.description
: Description of the fabric, including eco-friendly attributes.source
: Source or origin of the fabric.label
: Categorical label representing the fabric's type or category.
Download the dataset here.
-
Clone the Repository:
git clone https://github.com/Hacxmr/my_eco_tribe.git cd my_eco_tribe
-
Install Dependencies: Ensure you have Python 3.8+ installed. Then, install the required packages:
pip install streamlit pandas faiss-cpu scikit-learn numpy
-
Download the Dataset: Place the
fabric_frontiers.csv
file in the root directory of the project, or update the dataset URL in the code if needed.
-
Run the Streamlit Application:
streamlit run streamlit_app.py
-
Interact with the Application:
- Select a fabric from the dropdown menu.
- Click the "Recommend" button to view similar fabric suggestions.
-
Data Preprocessing:
- Combines
title
anddescription
fields for text analysis. - Transforms text data into numerical vectors using TF-IDF.
- Encodes categorical labels using one-hot encoding.
- Combines
-
Similarity Search:
- Creates a FAISS index for efficient similarity search.
- Searches for fabrics most similar to the selected fabric based on vectorized features.
-
Interactive Recommendations:
- Displays the top 5 fabric recommendations along with their descriptions and sources.
Selected Fabric: Organic Cotton
Recommended Fabrics:
- Hemp Fabric (Source: Sustainable Textiles)
- Description: Durable and eco-friendly fabric made from hemp fibers.
- Recycled Polyester (Source: EcoThreads)
- Description: Sustainable polyester made from recycled plastic bottles.
- Bamboo Rayon (Source: Nature's Fabrics)
- Description: Soft and eco-conscious fabric derived from bamboo pulp.
Contributions are welcome! If you want to contribute:
- Fork the repository.
- Make your changes.
- Submit a pull request.
For any queries or suggestions, feel free to reach out:
- GitHub: @Hacxmr
- Email: [email protected]