Python tutorials

What Does if __name__ == “__main__” Do in Python?

You’ve likely encountered Python’s if __name__ == “__main__” idiom when reading other people’s code. No wonder—it’s widespread! You might have even used if __name__ == “__main__” in your own scripts. But did you use it correctly? Maybe you’ve programmed in a C-family language like Java before, and you wonder whether this construct is a clumsy accessory to using a main() function as an entry point. Syntactically, Python’s if __name__ == “__main__” idiom is just a normal conditional block: 1if __name__ […]

Read more

N-gram Language Model Based Next Word Suggestion — Part 1

Have you ever wondered how, when typing a message on your phone, it’s able to suggest the next word? Or even being able to correct your spelling on the fly, turning your angry WhatsApp to your boss into a laughable matter because you end up telling them to go and duck themselves? One of the many ways to achieve next word suggestion is using an n-gram language model. This article briefly overviews what an n-gram language model is and how […]

Read more

pySBD: Hidden Gem for Sentence Boundary Detection

Although it may seem simple, human language is noisy and complex. Only up to a certain point does dividing text into sentences based only on punctuation make sense. The best thing about pySBD is that it can handle a wide range of edge cases, including abbreviations, decimal numbers, and other challenging situations that are frequently seen in corpora from the legal, financial, and biomedical fields. PySBD recognises sentence boundaries using a rule-based method, in contrast to the majority of other […]

Read more

Building Python Project Documentation With MkDocs

In this course, you’ll learn how to quickly build documentation for a Python package using MkDocs and mkdocstrings. These tools allow you to generate nice-looking and modern documentation from Markdown files and your code’s docstrings. Maintaining auto-generated documentation means less effort because you’re linking information between your code and the documentation pages. However, good documentation is more than just the technical description pulled from your code! Your project will appeal more to users if you guide them through examples and […]

Read more

Connecting the dots — SML

I was working on a paper titled “Web services learning Bot: A responsive, actionable AIML BOT Framework.” during my sophomore year. The bot discussed in this paper is based on AIML, a simple language for crafting conversational agents that anyone could learn, interpret, or extend.

Read more

Django 4.1: Improving Database Accessibility

Introduction Today’s commodity in all applications, written by all manner of different programming languages, is speed. For example, how fast we get our render, send our information, process complex operations, or in general, how fluent is the whole experience while using an application. We’ve developed a certain standard we expect from our applications. So how do we maintain that standard with    

Read more
1 79 80 81 82 83 181