Coder Social home page Coder Social logo

scia-premium / deepnlp Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.17 MB

Explore the cutting edge of NLP with this deep learning repository, featuring models for text classification, sentiment analysis, and more.

License: MIT License

Jupyter Notebook 100.00%
bleu-score covariance-matrix nlp sentiment-analysis

deepnlp's Introduction

DeepNLP Profile

Authors

Victor Simonin
Alexandre Lemonnier
Enguerrand De Gentile Duquesne


Lab1

The Lab1 describes two functions used in natural language processing to generate word embeddings, which are vector representations of words in a corpus that capture their meaning and relationships to other words. The first function, "compute_co_occurrence_matrix", creates a co-occurrence matrix from a given corpus, where each row and column corresponds to a unique word and the value at position (i,j) represents the number of times word i co-occurs with word j within a specified window size. The second function, "reduce_to_k_dim", uses truncated singular value decomposition (SVD) to reduce the dimensionality of the co-occurrence matrix to generate k-dimensional word embeddings.

Co-occurrence matrices are commonly used in natural language processing to represent the distributional semantics of words, i.e., the idea that words that appear in similar contexts have similar meanings. Truncated SVD is a technique commonly used in dimensionality reduction tasks that involve large matrices, as it can efficiently identify the most informative dimensions while discarding less relevant ones. Together, these techniques can be used to generate high-quality word embeddings that can be used in a variety of NLP tasks, such as sentiment analysis, text classification, and machine translation.

Lab2

The Lab2 discusses the use of attention mechanisms in machine learning models. The focus is on a specific scenario where the input is a set of values and their corresponding key vectors, and the goal is to obtain an output that is a good approximation of the average of two of these values.

It explains that in this scenario, by setting the dot product of the query vector and the key vectors corresponding to the two values much larger than the dot product with any other key vectors, the output will be heavily influenced by these two values and will be a good approximation of their average. The query vector is defined as a linear combination of the means of the key vectors for the two values.

It also discusses a scenario where the covariance matrix for one of the items is different from the others and includes a non-negligible term. This affects the norm of the corresponding key vector, which in turn affects the attention scores and the output vector.

It further suggests a way to use multi-headed attention to achieve the desired output when the key vectors have unknown covariances. This involves using two query vectors designed to focus on the two values of interest, and averaging the outputs obtained from single-headed attention using these query vectors.

deepnlp's People

Contributors

arkleme avatar bictole avatar engdomorphisme avatar

Watchers

 avatar

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.