Using PyO3, Rust helps Python to calculate lexical diversity

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ม.ค. 2025
  • I use PyO3 to write Rust code that I call from within Python to calculate lexical diversity, specifically the MTLD_wrap algorithm (MTLD = Measure of Textual Lexical Diversity).
    Thanks to Scott Jarvis for his Python code that highly informed my Python code here:
    github.com/ekb...
    Here's my Rust code:
    github.com/ekb...
    #corpuslinguistics #pythonprogramming #rustlang #pyo3

ความคิดเห็น • 10

  • @josecantu8195
    @josecantu8195 4 หลายเดือนก่อน +1

    Thanks Professor! I'm learning on the job on my own how to implement python & rust together given my interests in software development, data science & biomedical science so this is an interesting series you made!

    • @ekbphd3200
      @ekbphd3200  4 หลายเดือนก่อน

      Great to hear it!

  • @playea123
    @playea123 5 หลายเดือนก่อน

    This is fantastic! Thank you for sharing!!

    • @ekbphd3200
      @ekbphd3200  5 หลายเดือนก่อน +1

      You're very welcome!

  • @j-p-d-e-v
    @j-p-d-e-v 5 หลายเดือนก่อน +1

    I tried PyO3 and its actually a really good library. BTW great content.

    • @ekbphd3200
      @ekbphd3200  5 หลายเดือนก่อน

      Yeah, it seems to be well written and well documented. Thanks! I'm glad you enjoy my videos!

  • @SBrown-ou1xl
    @SBrown-ou1xl 5 หลายเดือนก่อน

    I thought about this a bit more, and I think the MTLD_wrap algorithm has a time complexity of O(n^2). It might be interesting to try to fit a quadratic to the scatter plot instead of a line!

    • @ekbphd3200
      @ekbphd3200  5 หลายเดือนก่อน

      Good idea. Is that different from the LOESS line?

  • @RealLexable
    @RealLexable 5 หลายเดือนก่อน +1

    But only as long Mojo isn't out there to perform python to it's coming new standard limits even faster than c++. The future is going to be fast as hell bro 🎉

    • @ekbphd3200
      @ekbphd3200  5 หลายเดือนก่อน

      Awesome!