Given an article, design an algorithm in pseudo code to find the top 150 most frequently co-occurring word-pairs in the article. Two words are said
Given an article, design an algorithm in pseudo code to find the top 150 most frequently co-occurring word-pairs in the article. Two words are said to co-occur if they appear in the same sentence. For example, the sentence, Its really a milestone in Chinese science fiction. contain the following word pairs:
('It's', 'really')
('It's', 'a')
('It's', 'milestone')
('It's', 'in')
('It's', 'Chinese')
('It's', 'science')
('It's', 'fiction')
('really', 'a')
('really', 'milestone')
('really', 'in')
('really', 'Chinese')
('really', 'science')
('really', 'fiction')
('a', 'milestone')
('a', 'in')
('a', 'Chinese')
('a', 'science')
('a', 'fiction')
('milestone', 'in')
('milestone', 'Chinese')
('milestone', 'science')
('milestone', 'fiction')
('in', 'Chinese')
('in', 'science')
('in', 'fiction')
('Chinese', 'science')
('Chinese', 'fiction')
('science', 'fiction')
you can assume you have access to a subroutine, sentenceSplitter(article), that can accurately segment an article into separate sentences and return these sentences in an array-like structure.
You can also assume that you have access to another routine tokenizer( sentence), that can accurately identify the individual words contained in the input sentence and return these words in another array-like data structure.
Please describe rhe algorithm unambiguously using pseudo code with necessary comments in English.
Don't implement the algorithm, only the pseudo code is required
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started