Update pages/Introduction.py
Browse files- pages/Introduction.py +7 -9
pages/Introduction.py
CHANGED
|
@@ -63,21 +63,19 @@ st.write("Vector for “I love NLP”: [1, 1, 1, 0, 0]")
|
|
| 63 |
st.markdown('<p style="color:lightblue;"><b>b. Term Frequency-Inverse Document Frequency (TF-IDF)</b></p>', unsafe_allow_html=True)
|
| 64 |
st.write("**TF-IDF** stands for Term Frequency Inverse Document Frequency of records. It can be defined as the calculation of how relevant a word in a series or corpus is to a text. The meaning increases proportionally to the number of times in the text a word appears but is compensated by the word frequency in the corpus (data-set).")
|
| 65 |
st.write("**Term Frequency:** In document d, the frequency represents the number of instances of a given word t. Therefore, we can see that it becomes more relevant when a word appears in the text, which is rational. Since the ordering of terms is not significant, we can use a vector to describe the text in the bag of term models. For each specific term in the paper, there is an entry with the value being the term frequency.")
|
| 66 |
-
st.write("The weight of a term that occurs in a document is simply proportional to the term frequency
|
| 67 |
-
st.write("tf(t,d) = count of t in d / number of words in d")
|
| 68 |
|
| 69 |
st.write("**Document Frequency:** This tests the meaning of the text, which is very similar to TF, in the whole corpus collection. The only difference is that in document d, TF is the frequency counter for a term t, while df is the number of occurrences in the document set N of the term t. In other words, the number of papers in which the word is present is DF.")
|
| 70 |
-
st.write("df(t) = occurrence of t in documents")
|
| 71 |
|
| 72 |
-
st.write("Inverse Document Frequency: Mainly, it tests how relevant the word is. The key aim of the search is to locate the appropriate records that fit the demand. Since tf considers all terms equally significant, it is therefore not only possible to use the term frequencies to measure the weight of the term in the paper. First, find the document frequency of a term t by counting the number of documents containing the term:")
|
| 73 |
-
st.write("df(t) = N(t)\nwhere:\n- df(t) = Document frequency of a term t\n- N(t) = Number of documents containing the term t")
|
| 74 |
|
|
|
|
|
|
|
| 75 |
|
| 76 |
|
| 77 |
-
|
| 78 |
-
st.write("idf(t) = N/ df(t) = N/N(t)")
|
| 79 |
-
st.write("The more common word is supposed to be considered less significant, but the element (most definite integers) seems too harsh. We then take the logarithm (with base 2) of the inverse frequency of the paper. So the if of the term t becomes: ")
|
| 80 |
-
|
| 81 |
|
| 82 |
|
| 83 |
|
|
|
|
| 63 |
st.markdown('<p style="color:lightblue;"><b>b. Term Frequency-Inverse Document Frequency (TF-IDF)</b></p>', unsafe_allow_html=True)
|
| 64 |
st.write("**TF-IDF** stands for Term Frequency Inverse Document Frequency of records. It can be defined as the calculation of how relevant a word in a series or corpus is to a text. The meaning increases proportionally to the number of times in the text a word appears but is compensated by the word frequency in the corpus (data-set).")
|
| 65 |
st.write("**Term Frequency:** In document d, the frequency represents the number of instances of a given word t. Therefore, we can see that it becomes more relevant when a word appears in the text, which is rational. Since the ordering of terms is not significant, we can use a vector to describe the text in the bag of term models. For each specific term in the paper, there is an entry with the value being the term frequency.")
|
| 66 |
+
st.write("The weight of a term that occurs in a document is simply proportional to the term frequency.\n tf(t,d) = count of t in d / number of words in d")
|
|
|
|
| 67 |
|
| 68 |
st.write("**Document Frequency:** This tests the meaning of the text, which is very similar to TF, in the whole corpus collection. The only difference is that in document d, TF is the frequency counter for a term t, while df is the number of occurrences in the document set N of the term t. In other words, the number of papers in which the word is present is DF.")
|
|
|
|
| 69 |
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
st.write("Inverse Document Frequency: Mainly, it tests how relevant the word is. The key aim of the search is to locate the appropriate records that fit the demand. Since tf considers all terms equally significant, it is therefore not only possible to use the term frequencies to measure the weight of the term in the paper. First, find the document frequency of a term t by counting the number of documents containing the term:\n df(t) = occurrence of t in documents")
|
| 72 |
+
st.write("df(t) = N(t)\nwhere:\n df(t) = Document frequency of a term t\n N(t) = Number of documents containing the term t")
|
| 73 |
|
| 74 |
|
| 75 |
+
|
| 76 |
+
st.write("Term frequency is the number of instances of a term in a single document only; although the frequency of the document is the number of separate documents in which the term appears, it depends on the entire corpus. Now let’s look at the definition of the frequency of the inverse paper. The IDF of the word is the number of documents in the corpus separated by the frequency of the text.\n idf(t) = N/ df(t) = N/N(t)")
|
| 77 |
+
st.write("The more common word is supposed to be considered less significant, but the element (most definite integers) seems too harsh. We then take the logarithm (with base 2) of the inverse frequency of the paper. So the if of the term t becomes: \n idf(t) = log(N/ df(t))")
|
| 78 |
+
|
| 79 |
|
| 80 |
|
| 81 |
|