Rajesh6 commited on
Commit
33f119e
·
verified ·
1 Parent(s): 4825ee3

Update pages/Introduction.py

Browse files
Files changed (1) hide show
  1. pages/Introduction.py +4 -4
pages/Introduction.py CHANGED
@@ -70,21 +70,21 @@ st.write('**TF - IDF Score:** \n - Combines TF and IDF to calculate the importan
70
  st.write("Examples:")
71
 
72
  st.write("""
73
- ### Example
74
  **Consider these two documents:**
75
 
76
  - "I love NLP"
77
  - "NLP is amazing"
78
 
79
- #### Step 1: Calculate TF
80
  - "NLP" appears once in each document, so its TF is **1/3** in both.
81
  - Words like "love" and "amazing" also have a TF of **1/3**.
82
 
83
- #### Step 2: Calculate IDF
84
  - "NLP" appears in both documents, so its IDF is **log(2/2) = 0**.
85
  - "love" and "amazing" appear in only one document each, so their IDF is **log(2/1) = 0.69**.
86
 
87
- #### Step 3: Compute TF-IDF
88
  - "NLP" gets a TF-IDF score of **1/3 × 0 = 0** (not unique).
89
  - "love" and "amazing" get scores of **1/3 × 0.69 = 0.23** (more unique).
90
  """)
 
70
  st.write("Examples:")
71
 
72
  st.write("""
73
+ **Example**
74
  **Consider these two documents:**
75
 
76
  - "I love NLP"
77
  - "NLP is amazing"
78
 
79
+ **Step 1: Calculate TF**
80
  - "NLP" appears once in each document, so its TF is **1/3** in both.
81
  - Words like "love" and "amazing" also have a TF of **1/3**.
82
 
83
+ **Step 2: Calculate IDF**
84
  - "NLP" appears in both documents, so its IDF is **log(2/2) = 0**.
85
  - "love" and "amazing" appear in only one document each, so their IDF is **log(2/1) = 0.69**.
86
 
87
+ **Step 3: Compute TF-IDF**
88
  - "NLP" gets a TF-IDF score of **1/3 × 0 = 0** (not unique).
89
  - "love" and "amazing" get scores of **1/3 × 0.69 = 0.23** (more unique).
90
  """)