Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado,...

10
Lift your Speed Limits with Cython Stefan Behnel <[email protected]> FOSDEM, Bruxelles, February 2018

Transcript of Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado,...

Page 1: Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado, asyncio – async web services lxml – XML / HTML parsing + processing ... NumPy

Lift your Speed Limits with Cython

Stefan Behnel <[email protected]>

FOSDEM, Bruxelles, February 2018

Page 2: Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado, asyncio – async web services lxml – XML / HTML parsing + processing ... NumPy

TrustScore® and Meta-Reviews

Page 3: Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado, asyncio – async web services lxml – XML / HTML parsing + processing ... NumPy

TrustYou Analytics

3 Mio. new text reviews every week

Page 4: Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado, asyncio – async web services lxml – XML / HTML parsing + processing ... NumPy

Why do we use Python ?

4

● Great programming language– versatle, pragmatc, concise, readable

● Community is diverse, friendly and helpful– well supported and documented

● Excellent libraries and tools– big data, NLP, web services,

automaton, testng, ...

Page 5: Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado, asyncio – async web services lxml – XML / HTML parsing + processing ... NumPy

Tools we use at TrustYou

5

● NumPy – fast matrix/array computaton● SciPy – advanced scientfc algorithms● Scikit-learn – machine learning● Pandas – data analysis● NLTK, SpaCy – text analysis● Tornado, asyncio – async web services● lxml – XML / HTML parsing + processing● ...

Page 6: Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado, asyncio – async web services lxml – XML / HTML parsing + processing ... NumPy

● NumPy● SciPy● Scikit-learn● Pandas● NLTK, SpaCy● Tornado, asyncio● lxml● ...

Tools we use at TrustYou

6

Python Data ecosystem:

● NumPy integrates Data● Cython integrates Code

Page 7: Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado, asyncio – async web services lxml – XML / HTML parsing + processing ... NumPy

● Fastest way to integrate natve code● Producton proven● Widely used● All about «getng things done»

– Pragmatc programming language

– Keeps focus on functonality, not boilerplate

– Allows moving freely between Python and C/C++

– As pythonic as you want, as natve as you need

● “We write C so you don‘t have to”

Why Cython?

7

Page 8: Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado, asyncio – async web services lxml – XML / HTML parsing + processing ... NumPy

Demo

8

Page 9: Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado, asyncio – async web services lxml – XML / HTML parsing + processing ... NumPy

Ideas for future features

9

● Comprehensions into C++ containers– vector(i*2 for i in range(8))

● Inline generators into loops– also in OpenMP parallel code

● @total_ordering decorator for extension types (C-implemented classes)– less code for fast object comparisons

● More sophistcated type inference

Page 10: Lift your Speed Limits with Cython - archive.fosdem.org · NLTK, SpaCy – text analysis Tornado, asyncio – async web services lxml – XML / HTML parsing + processing ... NumPy

Thanks!Any questons?

You can reach me at:[email protected]

10

Oh, and visit www.trustyou.com- check your next hotel

- we’re hiring :)