Giter VIP home page Giter VIP logo

Comments (6)

piskvorky avatar piskvorky commented on May 14, 2024

print_topics used to print the topics (hence the name, which is misleading now), but users complained that gensim is a library and as such shouldn't print anything. And I agree.

What I can do, is return a string instead of None. That way you'll be able to do print print_topics() and see output like in the log. It will make calling print_topics() from shell ugly though, so maybe I'll make that conditional (a parameter flag or smt).

Yeah now that I think of it, I'll rename print_topics to show_topics, and make print_topics an alias with that flag turned on.

from gensim.

strongh avatar strongh commented on May 14, 2024

Went ahead and took a shot at something like the change described in 5b10b6d85e6d3e366a06867f5ec321c69fe3db20. Not sure whether it's exactly what @piskvorky had in mind (e.g. I also changed print_topic) but it does the trick for me!

from gensim.

DataJunkie avatar DataJunkie commented on May 14, 2024

The other option that would be appropriate for a library is to have
that function return a list of strings, one for each topic.

On Thu, Aug 25, 2011 at 5:16 PM, strongh
[email protected]
wrote:

Went ahead and took a shot at something like the change described in 5b10b6d85e6d3e366a06867f5ec321c69fe3db20. Not sure whether it's exactly what @piskvorky had in mind (e.g. I also changed print_topic) but it does the trick for me!

Reply to this email directly or view it on GitHub:
#47 (comment)

RRR

from gensim.

strongh avatar strongh commented on May 14, 2024

@DataJunkie my version of show_topics returns a list of strings per topic when the keyword argument formatted is True. The strings are formatted as in the log files. Is this what you were thinking?

from gensim.

piskvorky avatar piskvorky commented on May 14, 2024

@strongh great, that is indeed what I had in mind :) I'll have a look & test & merge when I get back home (end of month). Thanks!

from gensim.

piskvorky avatar piskvorky commented on May 14, 2024

Fixed in #50 . Let me know if there are any further issues.

from gensim.

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.