Giter Club home page Giter Club logo

Comments (10)

hansharhoff avatar hansharhoff commented on May 20, 2024 4

I endend up using this example which has copied the relevant code to a single file:

https://github.com/UKPLab/sentence-transformers/tree/master/examples/applications/text-summarization

from lexrank.

LozanoAlvarezb avatar LozanoAlvarezb commented on May 20, 2024 1

Currently, the degree_centrality_scores function's code is only on dev. So the easiest would be to just clone the repository somewhere near your own code, checkout dev, and just import the function like that:

import sys
sys.path.append("../../lexrank/")
from lexrank.lexrank import  degree_centrality_score

Just for anyone who is here with the same problem

The import is

from lexrank.lexrank import degree_centrality_scores

with an "s"

Also, in the README there is a typo. Change every instance of "thershold" for "threshold"

from lexrank.

gniewus avatar gniewus commented on May 20, 2024

Currently, the degree_centrality_scores function's code is only on dev. So the easiest would be to just clone the repository somewhere near your own code, checkout dev, and just import the function like that:

import sys
sys.path.append("../../lexrank/")
from lexrank.lexrank import  degree_centrality_score

from lexrank.

openprivacy avatar openprivacy commented on May 20, 2024

I want to install the dev branch of lexrank from requirements.txt. https://stackoverflow.com/questions/20101834/pip-install-from-git-repo-branch suggests I can use

pip install -U git+https://github.com/crabcamp/lexrank.git@dev

but this results in installing lexrank-0.1.0 (a tag, not the dev branch). Any other suggestions (as the one suggested here fails pre-commit hooks).

from lexrank.

hansharhoff avatar hansharhoff commented on May 20, 2024

You can point to a specific commit e.g. git+https://github.com/crabcamp/lexrank.git@07bdd1579c408cf73cc822da303734d0a70cf3f7

but the current dev branch seems to be in a broken state where you cannot import lexrank at all.

from lexrank.

openprivacy avatar openprivacy commented on May 20, 2024

@hansharhoff Thank you for the response. I tried adding that to requirements.txt and get the following:

(rato-processing) » pip install -r requirements.txt 
Collecting en-core-web-sm@ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0.tar.gz
  Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.2.0/en_core_web_sm-3.2.0.tar.gz (13.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.9/13.9 MB 11.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting lexrank@ git+https://github.com/crabcamp/lexrank.git@07bdd1579c408cf73cc822da303734d0a70cf3f7
  Cloning https://github.com/crabcamp/lexrank.git (to revision 07bdd1579c408cf73cc822da303734d0a70cf3f7) to /tmp/pip-install-xa9e1of4/lexrank_5f66269c2deb4851b465f2dcf499c643
  Running command git clone --filter=blob:none --quiet https://github.com/crabcamp/lexrank.git /tmp/pip-install-xa9e1of4/lexrank_5f66269c2deb4851b465f2dcf499c643
  Running command git rev-parse -q --verify 'sha^07bdd1579c408cf73cc822da303734d0a70cf3f7'
  Running command git fetch -q https://github.com/crabcamp/lexrank.git 07bdd1579c408cf73cc822da303734d0a70cf3f7
  Resolved https://github.com/crabcamp/lexrank.git to commit 07bdd1579c408cf73cc822da303734d0a70cf3f7
  Preparing metadata (setup.py) ... done
...
Building wheels for collected packages: lexrank
  Building wheel for lexrank (setup.py) ... done
  Created wheel for lexrank: filename=lexrank-0.1.0-py3-none-any.whl size=69896 sha256=35ab5ddf261aaefa33f8051eb3f37c0eadbced9639bdbf1d658f609cc486188c
  Stored in directory: /home/fen/.cache/pip/wheels/17/44/a6/7f5d731bb4dab8c972e429a5edf728ad82830eb6cb4f4c4975
Successfully built lexrank
Installing collected packages: lexrank
Successfully installed lexrank-0.1.0

which, of course, is not the version I want. Is it because "the current dev branch seems to be in a broken state where you cannot import lexrank at all"? Can anything be done (without access to pushing changes)? I suppose I could fork it...

from lexrank.

openprivacy avatar openprivacy commented on May 20, 2024

@hansharhoff thank you - that worked!

from lexrank.

agombert avatar agombert commented on May 20, 2024

Works perfectly thanks @hansharhoff

from lexrank.

enayet-hossain avatar enayet-hossain commented on May 20, 2024

I am using the bert-extractive-summarizer package. However, sometimes I get +/-inf values as the centrality score. I dug a little deeper and found that the eigenvalues are coming as +/-inf. And this is probably caused by near-zero cosine similarity scores. If I add a constant such as 1.1 with all the cosine similarity scores, I do not get the +/-inf values anymore.
My question is - does adding a particular constant to the cosine similarity score, in this case, bias the centrality score? I just wanted to know if there is any better solution in this particular case.
Thank you in advance.

from lexrank.

deankim07 avatar deankim07 commented on May 20, 2024

@hansharhoff thank you!

from lexrank.

Related Issues (5)

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.