Natural Language Processing (NLP) with Python — Tutorial

Categories:

Recommended

So, you’ve never programmed before. As we go through this tutorial, I will attempt to teach you how to program. There really is only one way to learn to program. You must read code and write code (as computer programs are often called). I’m going to show you lots of code. You should type in code that I show you to see what happens. Play around with it and make changes. The worst that can happen is that it won’t work. When I type in code it will be formatted like this:

# Python is easy to learn
print("Hello, World!")

That’s so it is easy to distinguish from the other text. If you’re reading this on the Web, you’ll notice the code is in color — that’s just to make it stand out, and to make the different parts of the code stand out from each other. The code you enter will probably not be colored, or the colors may be different, but it won’t affect the code as long as you enter it the same way as it’s printed here.

If the computer prints something out it will be formatted like this:

Hello, World!

(Note that printed text goes to your screen, and does not involve paper. Before computers had screens, the output of computer programs would be printed on paper.)

Note that this is a Python 3 tutorial, which means that most of the examples will not work in Python 2.7 and before. As well, all but a small number of the extra Python 2.7 libraries (third-party libraries) have been converted to Python 3. Most likely you will want to learn Python 3, but if you are learning Python for a specific package or set of modules that are only written in Python 2.7, you may want to consider learning from the Non-Programmer’s Tutorial for Python 2.6. However, the differences between Python 2 and 3 are not particularly large, so if you learn one, you should be able to read programs written for the other without much difficulty.

There will often be a mixture of the text you type (which is shown in bold) and the text the program prints to the screen, which would look like this:

Halt!
Who Goes there? Josh
You may pass, Josh

(Some of the tutorial has not been converted to this format. Since this is a wiki, you can convert it when you find it.)

I will also introduce you to the terminology of programming – for example, that programming is often referred to as coding or hacking. This will not only help you understand what programmers are talking about, but also help the learning process.

Now, on to more important things. In order to program in Python you need the Python 3 software. If you don’t already have the Python software go to www.python.org/download and get the proper version for your platform. Download it, read the instructions and get it installed.

Category:

Attribution

Natural Language Processing (NLP) with Python — Tutorial. https://medium.com/towards-artificial-intelligence/natural-language-processing-nlp-with-python-tutorial-for-beginners-1f54e610a1a0

VP Flipbook Maker

Convert your work to digital flipbook with VP Online Flipbook Maker! You can also create a new one with the tool. Try it now!