import streamlit as st st.markdown(""" """, unsafe_allow_html=True) st.markdown("

🛠️ Feature Engineering 📌

", unsafe_allow_html=True) st.markdown( """

🔹 When we take existing features from collected data and create new useful features, where this is automatically engineered made from existing features and the technique of creating the features is known as Feature Engineering.

These engineered features enhance machine learning models.

A subpart of feature engineering is Feature Extraction.

""", unsafe_allow_html=True ) st.subheader(":violet[Feature Extraxtion]") st.markdown( """

📝 Feature Extraction is the process where text data which is natural language is given to machine to understand the natural language.

""", unsafe_allow_html=True ) st.header("Vectorization🧭") st.markdown( """

Vectorization is the process of converting text into vector.

This allows ML models to process text data effectively.

""", unsafe_allow_html=True ) st.subheader(":violet[Vectorization techniques]") st.markdown(""" There a different techniques to convert text into vector format.They are : """, unsafe_allow_html=True) st.markdown(""" There are advance vectorization techniques.They are : """, unsafe_allow_html=True) st.sidebar.title("Navigation 🧭") file_type = st.sidebar.radio( "Choose a Vectorization technique :", ("One-Hot Vectorization", "Bag of Words(BOW)", "Term Frequency - Inverse Document Frequency(TF-IDF)")) if file_type == "One-Hot Vectorization": st.title(":red[One-Hot Vectorization]") st.markdown(""" ### 📌 What is One-Hot Vectorization? - It is a type of vectorization technique where text is converted into a numerical vector. - This technique helps in representing words as unique vectors for machine learning models. """) st.markdown(""" ### 🛠️ Steps in One-Hot Vectorization: - Create a Vocabulary ➡️ (A set of all unique words in the collected corpus). - Find the Length of Vocabulary ➡️ (Total number of unique words = d-dimensions). - Convert Each Word into a Vector: - Every unique word is transformed into a vector. - Each vector has d-dimensions, where each dimension corresponds to a unique word. - Words are converted individually, and then combined to form a vector. This technique ensures that each word is treated uniquely and efficiently in NLP tasks. """) st.markdown(""" - Each word gets a unique vector representation. - The number of dimensions = total vocabulary size. - Words are vectorized separately, then combined into document vectors. """) st.markdown(""" | **Word** | **Vector Representation** | |----------|--------------------------| | **toy** | [1,0,0,0,0] | | **is** | [0,1,0,0,0] | | **good** | [0,0,1,0,0] | | **not** | [0,0,0,1,0] | | **bad** | [0,0,0,0,1] | """, unsafe_allow_html=True) st.markdown(""" - d₁ → v₁ → `[[1,0,0,0,0] , [0,1,0,0,0] , [0,0,1,0,0]]` - d₂ → v₂ → `[[1,0,0,0,0] , [0,1,0,0,0] , [0,0,0,1,0] , [0,0,1,0,0]]` - d₃ → v₃ → `[[0,0,0,0,1], [1,0,0,0,0]]` This One-Hot Vectorization technique converts words into numerical vectors while preserving their uniqueness. """) st.markdown(""" ### Key Takeaways: - Each word is represented as a 5-dimensional vector. - Every dimension corresponds to a unique word in the vocabulary. - This method is useful for transforming text into a numerical format for Machine Learning tasks. """)