GithubHelp home page GithubHelp logo

sergegoussev / nlpru Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 158 KB

Library to support natural language processing of Russian text

Home Page: https://sergegoussev.github.io/nlpru-docs/

License: MIT License

Python 100.00%
natural-language-processing russian twitter

nlpru's People

Contributors

sergegoussev avatar

Stargazers

 avatar

nlpru's Issues

similarity_to in Get_similarity() specified as parameter but it does nothing

In the Semantics object, the Get_similarity() method has a parameter similarity_to that is meant to represent how the output will be formatted. It is however never used in the method.

    def Get_similarity(self,
                       docs_list,
                       use_normal_form=False,
                       clean_documents=True,
                       stop_words=None,
                       similarity_to='first',
                       use_ngrams=True):
        """
        Get cosine similarity of documents. Uses sklearn's library and the 
        tf-idf approach (TfidfVectorizer()) to calculate result

        (unique) params:
            - stop_words: list (or set) of stop words to use
            - similarity_to: 'first' or 'all' expected

        returns: 
            depending on 'similarity_to' param, either similarity row 
            vector of the first document to all others docs is returned, or
            (if 'All' is specified) matrix of of all docs against all others
        """
        if clean_documents == True:
            docs_list = self.__clean_docs__(docs_list)
        if use_normal_form == True:
            docs_list = self.__normalize_docs__(docs_list)
        if use_ngrams == True:
            tfidf_vectorizer = TfidfVectorizer(
                stop_words=stop_words, ngram_range=(2, 3))
        else:
            tfidf_vectorizer = TfidfVectorizer(stop_words=stop_words)
        tfidf_matrix = tfidf_vectorizer.fit_transform(docs_list)
        cosine_similarity_matrix = cosine_similarity(
            tfidf_matrix[0:1], tfidf_matrix)
        return cosine_similarity_matrix

Topic categorization - missing ability to avoid specific keywords

When FindTopics.Keyword_Match() is used, it simply matches on the presence of certain words. While it handles the case of keyword overuse (i.e. if a tweet can be categorized to two topics as both topics have the same keyword they are looking for) there is not ability to avoid specific keyword when categorizing tweets.

Example:

Say for instance the tweet is "Он бот, но хоть смешной!!" and we want to categorize tweets that are (a) about just bots, and (b) about funny bots. There is no way to segregate the topic categorization to be so nuanced as look for the same work 'бот', but in one topic use the word 'смешной' but in another topic avoid it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.