Git Product home page Git Product logo

Comments (2)

AdamSpannbauer avatar AdamSpannbauer commented on July 24, 2024

The call you show above is attempting to use the entire contents of df$contentraw and produce a single summary sentence from all the text in the column. As shown in the error, working with a large corpus is very memory intensive and depending on the input size, your system may not be able to handle it.

If you are trying to run the lexRank process on one url at a time you will need to iterate over the urls yourself or use something such as data.table's by operator (example below). This is less likely to run into the memory issues you experienced.

library(data.table)

dt = data.table(contentraw = c('This is a test sentence.  Second sentence.  Test sentence again.',
                               'This is another document.  More words.  More document words.',
                               'Last doc.  More text doc.  Third sentence.'),
                url = 1:3)

dt[, lexRankr::lexRank(contentraw, 
                       docId = url,
                       n = 1,
                       continuous = FALSE,
                       returnTies = FALSE),
   by = url]

#    url docId sentenceId                 sentence     value
# 1:   1     1        1_1 This is a test sentence. 0.3333333
# 2:   2     2        2_3     More document words. 0.4864865
# 3:   3     3        3_1                Last doc. 0.5000000

from lexrankr.

cspenn avatar cspenn commented on July 24, 2024

Many thanks - was trying lapply and ran into similar. Appreciate it!

from lexrankr.

Related Issues (14)

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.