Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some key_words have multiple different clean_names #71

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Dec 20, 2018

  1. set the _keyword=set() for some keyword has multiple different clean_…

    …names
    
    For example:
        keyword_processor = KeywordProcessor()
        keyword_dict = {"news_channel": ["CNN","CCTV","BBC"],"neural_network": ["CNN", "RNN"]}
        keyword_processor.add_keywords_from_dict(keyword_dict)
        keyword_processor.extract_keywords('I like CNN')
    we hope get result as follows:
       ("news_channel", "neural_network")
    Drxan authored Dec 20, 2018
    Configuration menu
    Copy the full SHA
    f982ba4 View commit details
    Browse the repository at this point in the history
  2. Some key_words have multiple different clean_names

    For example:
        keyword_processor = KeywordProcessor()
        keyword_dict = {"news_channel": ["CNN","CCTV","BBC"],"neural_network": ["CNN", "RNN"]}
        keyword_processor.add_keywords_from_dict(keyword_dict)
        keyword_processor.extract_keywords('I like CNN')
    we hope get result as follows:
       "news_channel_|_neural_network"
    we can use str.split() to get real clean name as follows:
      "news_channel_|_neural_network".split('_|_') ==> ["news_channel", "neural_network"]
    Drxan authored Dec 20, 2018
    Configuration menu
    Copy the full SHA
    5b4d8cd View commit details
    Browse the repository at this point in the history