Git Product home page Git Product logo

Comments (5)

andreskull avatar andreskull commented on May 23, 2024

The workaround using tm+quanteda:
vs <- VectorSource(texts)
corp <- Corpus(vs)
corp <- tm_map(corp, removeWords, stopwords("english"))
corp <- tm_map(corp, stemDocument)
corp2 <- corpus(corp)
dtm <- dfm(corp2, clean=TRUE, bigrams=TRUE, stem=FALSE)

from quanteda.

kbenoit avatar kbenoit commented on May 23, 2024

Fixed in 0.8.7-8.

> dfm("Banking industry", stem = TRUE, ngrams = 2, verbose = FALSE)
Document-feature matrix of: 1 document, 1 feature.
1 x 1 sparse Matrix of class "dfmSparse"
       features
docs    bank_industri
  text1             1
> wordstem(tokenize("Banking industry", n = 2))
tokenizedText object from 1 document.
Component 1 :
[1] "Bank_industri"

from quanteda.

atheeralattar avatar atheeralattar commented on May 23, 2024

How does the stem completion works in quanteda, sorry if the question looks too basic but I couldn't find the answer so I decided to use the last resort (Ask the developer).

from quanteda.

koheiw avatar koheiw commented on May 23, 2024

You can do this by stemming words before making ngrams:

toks <- tokens(data_corpus_inaugural)
toks_stem <- tokens_wordstem(toks)
toks_stem_bigram <- tokens_ngrams(toks_stem)

from quanteda.

kbenoit avatar kbenoit commented on May 23, 2024

@atheeralattar stem completion is not implemented in quanteda. What's the use case for this? I've always been curious as to why people need this.

from quanteda.

Related Issues (20)

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.