Skip to content

Commit 3352bce

Browse files
committed
Improved the descriptive text in index.md.
1 parent 5ad6815 commit 3352bce

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docs/src/index.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,10 @@ section.
105105

106106
### Single Document Analysis
107107

108-
In the code cell below, contingency tables are created for the word "innovation" within the string `text_sample`, including all its collocates that occur within a 5-word context window and appear at least once.
109-
Subsequently, `PMI` (Pointwise Mutual Information) scores are computed for all collocates, and the top five collocates along with their scores are displayed in a `DataFrame`.
108+
In the code cell below, contingency tables are created for the word "innovation" within the `text_sample`. These tables record all words that occur within a 5-word window around innovation and appear at least once. Based on these counts, `PMI` (Pointwise Mutual Information) scores are computed to measure the strength of association between innovation and each of its collocates. The top five collocates with the highest PMI scores are then displayed in a `DataFrame`.
110109

111110
```@example basic
112111
using TextAssociations
113-
using TextAnalysis: text
114112
using DataFrames
115113
116114
text_sample = """
@@ -126,7 +124,7 @@ ct = ContingencyTable(text_sample, "innovation";
126124
minfreq=1,
127125
norm_config=TextNorm(strip_punctuation=true, strip_case=true))
128126
129-
# Calculate
127+
# Calculate PMI for ct, sort and return the top 5 collocates with their scores
130128
pmi_scores = assoc_score(PMI, ct)
131129
sort!(pmi_scores, :PMI, rev=true)
132130
first(pmi_scores, 5)

0 commit comments

Comments
 (0)