Extractor¶
-
class
nlp.extractor.
NLPExtractor
[source]¶ -
-
static
calculate_word_scores
(phrase_list)[source]¶ Calculates words scores based on their frequency and degree.
Parameters: phrase_list (list) – List of phrases to be processed. Returns: mapping between word and its score.
-
static
generate_candidate_keyword_scores
(phrase_list, word_score)[source]¶ Generates scores for candidate keywords.
Parameters: Returns: mapping between phrases and their scores.
-
static
generate_candidate_keywords
(sentence_list, stopword_pattern)[source]¶ Generates list of keywords candidates.
Parameters: Returns: list of keywords
-
static
is_number
(word)[source]¶ Checks whether word is a number.
Parameters: word (str) – Word to be checked. Returns: True or False
-
load_stop_words
()[source]¶ Utility function to load stop words from a file and return as a list of words.
Returns: list A list of stop words.
-
run
(text)[source]¶ Extracts keywords from the text.
Parameters: text (str) – Text to be processed. Returns: list of keywords.
-
static