Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
fastText Quick Start Guide

You're reading from  fastText Quick Start Guide

Product type Book
Published in Jul 2018
Publisher Packt
ISBN-13 9781789130997
Pages 194 pages
Edition 1st Edition
Languages
Author (1):
Joydeep Bhattacharjee Joydeep Bhattacharjee
Profile icon Joydeep Bhattacharjee

Python 2 and Python 3

fastText works for both Python 2 and Python 3. There are few differences though that you should keep in mind for the particular python version.

  1. print is a statement in Python 2 and a function in Python 3. This would mean that if you are in a Jupyter notebook and trying to see the changes in a variable you will need to pass the appropriate print statement in the corresponding python version.
  2. The fastText handles text as Unicode. Python 3 also handles text as Unicode and hence there is no additional overhead if you code in Python 3. But in case you are developing your models in Python 2, you cannot have your data as a string instance. You will need to have your data as Unicode. Following is an example of text as an instance of the str class and unicode class in Python 2.
>>> text1 = "some text" # this will not work for fastText
>>...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}