How to use BERTopic - Machine Learning Assisted Topic Modeling in Python

Поділитися
Вставка
  • Опубліковано 6 вер 2024
  • Join this channel to get access to perks:
    / @python-programming
    If you enjoy this video, please subscribe.
    ✅Be my Patron: / wjbmattingly
    ✅PayPal: www.paypal.com...
    Article Referenced: www.ncbi.nlm.n...
    GitHub Repo: github.com/wjb...
    GitHub BERTopic: github.com/Maa...
    If there's a specific video you would like to see or a tutorial series, let me know in the comments and I will try and make it.
    If you liked this video, check out www.PythonHumanities.com, where I have Coding Exercises, Lessons, on-site Python shells where you can experiment with code, and a text version of the material discussed here.
    You can follow me at:
    / wjb_mattingly

КОМЕНТАРІ • 48

  • @muhammadarhamriaz629
    @muhammadarhamriaz629 Рік тому +2

    I am brand new to DAW and soft soft - these tutorials are excellent an very helpful to get soone like up and running. Appreciate

  • @wasgeht2409
    @wasgeht2409 Рік тому +4

    two questions :) 1) Could i write a sentence and they give me after the training the probability for the topic based on the training ? 2) Could i use for example customer requests for training ? in this case you are using a unstructured data. I hope u understand my questions :D

  • @rvian4
    @rvian4 11 місяців тому +1

    wow the features this bert approach provides really improves explanation of topic models

  • @dubey_ji
    @dubey_ji Рік тому +3

    i found your channel today
    and man I must say thank you
    very good content

  • @hankzhong
    @hankzhong Рік тому +4

    Great intro, but the default has too many topics to be useful for human understanding, is there a way to reduce the number of topics naturally? Also can we measure perplexity and coherence of these topics like LDA? Thanks

  • @xevenau
    @xevenau 8 місяців тому +1

    Do you happen to have a tutorial that explains how to turn articles into a dataset for topic modeling. Thanks!

  • @sarasharick5209
    @sarasharick5209 Рік тому +1

    Great video. I experimented with Top2Vec after that video, so looking forward to experimenting with BERTopic too.

  • @danieleriahe-him4693
    @danieleriahe-him4693 Рік тому +2

    Thanks so much for the high quality content you published so far, your playlist are a gold mine for beginners and enthusiast into the AI field.
    Have you ever considered making a video to explain principles of creating an efficient dataset for text summarization, or other specific tasks?
    Many thanks in advance for your consideration!

  • @somewhereovertherainbow9550
    @somewhereovertherainbow9550 Місяць тому

    Thanks!!! very much helpful!

  • @bentobenack2
    @bentobenack2 2 роки тому +1

    This is incredible, I subscribed to your channel today while looking for topic modeling content, I found very good content. However, I would also like to find something from BERTopic, and a few minutes later after subscribed, I receive a notification from UA-cam of your channel, and I said, it can't be true!
    Thank a lot!

    • @python-programming
      @python-programming  2 роки тому +1

      Haha! That is so perfect! Hope this video helps!!

    • @bentobenack2
      @bentobenack2 2 роки тому

      @@python-programming Definitely helped!

  • @mmishrafaculty
    @mmishrafaculty Рік тому +2

    Awesome. That was so informative. And explained so clearly. Thank you so much.

    • @python-programming
      @python-programming  Рік тому +1

      Thanks so much! I am planning a new video on BERTopic soon to cover its new features.

  • @TheArnold2002
    @TheArnold2002 Рік тому +1

    Best video on topic modeling I've seen so far. Can I get all documents related to a topic, instead of just the top 3?

    • @python-programming
      @python-programming  Рік тому +1

      Thanks! Indeed you can. BerTopic has changed a bit since I made this video, so I will have to check the docs but I am certain you can.

  • @BillVoisine
    @BillVoisine 2 місяці тому

    Thank you!!

  • @suhasp2385
    @suhasp2385 Рік тому

    Just simply put the code, it works! thanks!

  • @raziehfadaei4801
    @raziehfadaei4801 6 місяців тому

    Thank you for your good video.
    Does BERTopic need any preprocesing like lemmatization or tokenization like LDA?

  • @user-rd2nn6fm1o
    @user-rd2nn6fm1o Рік тому +1

    this was so informative, thank you.

  • @kennethgomes4727
    @kennethgomes4727 Рік тому +1

    Please can you explain why didnt you use UMAP, HDBSCAN and C-TF-IDF for this?

    • @python-programming
      @python-programming  Рік тому

      Thanks for the question! You absolutely can. I have a whole other tutorial that walks through each of those steps. I think BERTopic, LeetTopic (my library), and Top2Vec provide a simpler solution for those who may not be familiar with a custom UMAP, HDBScan workflow. I try to make tutorials for users at all levels and I think these other libraries address the needs of those newer to Python/ML.

  • @andreasheiner3426
    @andreasheiner3426 Рік тому +1

    Thanks, great tutorial.
    A question, what's your experience with quality of the model and sentence? Short sentences don't really work (to little semantics), long won't work either (too "much" semantics). Thoughts?

    • @python-programming
      @python-programming  Рік тому

      Thanks! And great question. If you are looking for an off the shelf solution try top2vec, but I think you may run into similar issues. What language are your docs? Also, how varied are they in size? A more custom solution may be necessary.

    • @andreasheiner3426
      @andreasheiner3426 Рік тому

      @@python-programming I've standard English web sites, from product reviews to travel reports. Generally a page contains some 10 paragraphs. Content on a page is highly correlated (you'd expect), so the page content is defined by a few paragraphs. The topic of a paragraph is mostly in a single sentence; the rest is "glue". This turns out to be a reasonable assumption (eye balling).
      BERTopic supports these observations, especially if you remove paragraphs with the topic probability for the most dominant topic less than some cutoff (say 0.6; the reason that, worst case another topic is present for at most 0.4). From experience you're left with 3% unallocated documents; each allocated document has at most 3 topics.
      This is all nice, assuming BERTopic gives good results for both long and short paragraphs with the same hyper parameters. If my assumption is incorrect I've a problem :(
      So, thoughts?

  • @hosseinahmadi1855
    @hosseinahmadi1855 7 місяців тому

    Greeeeeeeeat!. Thanks. Another useful video

  • @KR-good
    @KR-good 6 місяців тому

    Great presentation.

  • @johnny_silverhand
    @johnny_silverhand 2 роки тому

    Fantastic explanation

  • @mrtn5882
    @mrtn5882 2 роки тому +2

    Nice tutorial, thank you! If I follow the video correctly, about 25% of your documents are marked as outliers. Is that normal? Can you maybe talk about this a bit in a further video?

    • @python-programming
      @python-programming  2 роки тому +4

      Yea that is a bit normal woth BERTopic. I plan to do another video that compares dofferent topic modeling approaches and that will be a key feature

    • @mrtn5882
      @mrtn5882 Рік тому

      @@python-programming Great, I’m looking forward to that video! 😊

  • @wasgeht2409
    @wasgeht2409 Рік тому +1

    Wow

  • @emekaobiefuna4509
    @emekaobiefuna4509 Рік тому

    Great info!

  • @luiztauffer8513
    @luiztauffer8513 Рік тому +1

    Thanks for the amazing content! Do you know if BERTopic could be used to train a model to identify similarity to custom, pre-defined topic?

    • @python-programming
      @python-programming  Рік тому +1

      Thanks! I would not use BERTopic, rather soaCy for text classification. You could use BERTopic to gather data for easy labeling.

    • @luiztauffer8513
      @luiztauffer8513 Рік тому

      @@python-programming thanks a lot, I actually went on to search for it and found another one of your videos explaining EXACTLY what I wanted! For reference it's this one: "The EASIEST! way to do Text Classification with spaCy and Classy Classification"
      thanks again!

    • @python-programming
      @python-programming  Рік тому

      @@luiztauffer8513 haha! Perfect! No problem!

  • @johnny_silverhand
    @johnny_silverhand 2 роки тому

    Best topic model to use for modelling 3000 documents each having 3 pages of text ?

    • @adambenari3944
      @adambenari3944 Рік тому +1

      BERTopic or Top2Vec will both work, but you'll need to reduce your corpus to shorter text. You can use an introduction or conclusion as your text, or perform some summarization before you start modelling

  • @tantzer6113
    @tantzer6113 2 роки тому +1

    Does this work for Arabic documents?

    • @python-programming
      @python-programming  2 роки тому +1

      As long as there is a BERT model for Arabic, yes. I know there is an NEH funded project for this but I am not sure if it is available yet. There is a lot of research in Arabic NLP so I would be surprised if another does not already exost. I do not have Arabic, though, so I cannot validate the results.

    • @tantzer6113
      @tantzer6113 2 роки тому

      @@python-programming Thank you for answering.

  • @flosrv3194
    @flosrv3194 3 місяці тому

    no way to install this shit, get error popping from everywhere and when i resolve them, thre others appear, unusable crap

  • @LearnProfessional1
    @LearnProfessional1 Рік тому

    is tNice tutorials ASMR?

  • @olucasharp
    @olucasharp Рік тому +1

    Comment to say thanks and support this absolutely awesome channel 🪩
    Huge thanks and this is sooo clearly explained, good luck ⚡

    • @python-programming
      @python-programming  Рік тому

      Thank you so much for your support and this wonderful comment!