-
Notifications
You must be signed in to change notification settings - Fork 236
Update README.md #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mk2510
wants to merge
8
commits into
jbesomi:master
Choose a base branch
from
SummerOfCode-NoHate:Update_README.md
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update README.md #117
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
08990e0
Update README.md
maxkrahn-beep b45ced8
Merge branch 'master' into Update_README.md
mk2510 0f5c0c7
removed the >>>
maxkrahn-beep 2c97af5
Merge branch 'master_upstream' into Update_README.md
mk2510 34f8b35
added types to README.md
mk2510 df5b79a
Update README (normalization; DocumentTermDF)
henrifroese 8afe9b4
updated README.md to incorporate the type changes
mk2510 afde59e
incorp suggested changes
mk2510 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |
| <a href="https://github.com/jbesomi/texthero/blob/master/LICENSE"> | ||
| <img src="https://img.shields.io/github/license/jbesomi/texthero.svg" | ||
| alt="Github license"> | ||
| </a> | ||
| </a> | ||
| </p> | ||
|
|
||
| <p align="center"> | ||
|
|
@@ -44,7 +44,7 @@ | |
|
|
||
| <h2 align="center">From zero to hero</h2> | ||
|
|
||
| Texthero is a python toolkit to work with text-based dataset quickly and effortlessly. Texthero is very simple to learn and designed to be used on top of Pandas. Texthero has the same expressiveness and power of Pandas and is extensively documented. Texthero is modern and conceived for programmers of the 2020 decade with little knowledge if any in linguistic. | ||
| Texthero is a python toolkit to work with text-based dataset quickly and effortlessly. Texthero is very simple to learn and designed to be used on top of Pandas. Texthero has the same expressiveness and power of Pandas and is extensively documented. Texthero is modern and conceived for programmers of the 2020 decade with little knowledge if any in linguistic. | ||
|
|
||
| You can think of Texthero as a tool to help you _understand_ and work with text-based dataset. Given a tabular dataset, it's easy to _grasp the main concept_. Instead, given a text dataset, it's harder to have quick insights into the underline data. With Texthero, preprocessing text data, mapping it into vectors, and visualizing the obtained vector space takes just a couple of lines. | ||
|
|
||
|
|
@@ -55,15 +55,15 @@ Texthero include tools for: | |
| * Vector space analysis: clustering (K-means, Meanshift, DBSCAN and Hierarchical), topic modeling (wip) and interpretation. | ||
| * Text visualization: vector space visualization, place localization on maps (wip). | ||
|
|
||
| Texthero is free, open-source and [well documented](https://texthero.org/docs) (and that's what we love most by the way!). | ||
| Texthero is free, open-source and [well documented](https://texthero.org/docs) (and that's what we love most by the way!). | ||
|
|
||
| We hope you will find pleasure working with Texthero as we had during his development. | ||
|
|
||
| <h2 align="center">Hablas español? क्या आप हिंदी बोलते हैं? 日本語が話せるのか?</h2> | ||
| <h2 align="center">¿Hablas español? क्या आप हिंदी बोलते हैं? 日本語が話せるのか?</h2> | ||
|
|
||
| Texthero has been developed for the whole NLP community. We know how hard it is to deal with different NLP tools (NLTK, SpaCy, Gensim, TextBlob, Sklearn): that's why we developed Texthero, to simplify things. | ||
|
|
||
| Now, the next main milestone is to provide *multilingual support* and for this big step, we need the help of all of you. ¿Hablas español? Sie sprechen Deutsch? 你会说中文? 日本語が話せるのか? Fala português? Parli Italiano? Вы говорите по-русски? If yes or you speak another language not mentioned here, then you might help us develop multilingual support! Even if you haven't contributed before or you just started with NLP, contact us or open a Github issue, there is always a first time :) We promise you will learn a lot, and, ... who knows? It might help you find your new job as an NLP-developer! | ||
| Now, the next main milestone is to provide *multilingual support* and for this big step, we need the help of all of you. ¿Hablas español? Sprechen Sie Deutsch? 你会说中文 日本語が話せるのか?Fala português? Parli Italiano? Вы говорите по-русски? If yes or you speak another language not mentioned here, then you might help us develop multilingual support! Even if you haven't contributed before or you just started with NLP, contact us or open a Github issue, there is always a first time :) We promise you will learn a lot, and, ... who knows? It might help you find your new job as an NLP-developer! | ||
|
|
||
| For improving the python toolkit and provide an even better experience, your aid and feedback are crucial. If you have any problem or suggestion please open a Github [issue](https://github.com/jbesomi/texthero/issues), we will be glad to support you and help you. | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the "Beta version" part still make sense (@jbesomi )? |
||
|
|
@@ -92,7 +92,7 @@ pip install texthero | |
|
|
||
| <h2 align="center">Getting started</h2> | ||
|
|
||
| The best way to learn Texthero is through the <a href="https://texthero.org/docs/getting-started">Getting Started</a> docs. | ||
| The best way to learn Texthero is through the <a href="https://texthero.org/docs/getting-started">Getting Started</a> docs. | ||
|
|
||
| In case you are an advanced python user, then `help(texthero)` should do the work. | ||
|
|
||
|
|
@@ -106,13 +106,15 @@ import texthero as hero | |
| import pandas as pd | ||
|
|
||
| df = pd.read_csv( | ||
| "https://github.com/jbesomi/texthero/raw/master/dataset/bbcsport.csv" | ||
| "https://github.com/jbesomi/texthero/raw/master/dataset/bbcsport.csv" | ||
| ) | ||
|
|
||
| df['pca'] = ( | ||
| df['text'] | ||
| .pipe(hero.clean) | ||
| .pipe(hero.tokenize) | ||
| .pipe(hero.tfidf) | ||
| .pipe(hero.normalize) | ||
| .pipe(hero.pca) | ||
| ) | ||
| hero.scatterplot(df, 'pca', color='topic', title="PCA BBC Sport news") | ||
|
|
@@ -132,19 +134,20 @@ df = pd.read_csv( | |
| "https://github.com/jbesomi/texthero/raw/master/dataset/bbcsport.csv" | ||
| ) | ||
|
|
||
| df['tfidf'] = ( | ||
| df['tokenized'] = ( | ||
| df['text'] | ||
| .pipe(hero.clean) | ||
| .pipe(hero.tfidf) | ||
| .pipe(hero.tokenize) | ||
| ) | ||
|
|
||
| df['kmeans_labels'] = ( | ||
| df['tfidf'] | ||
| df['tokenized'] | ||
| .pipe(hero.tfidf) | ||
| .pipe(hero.normalize) | ||
| .pipe(hero.kmeans, n_clusters=5) | ||
| .astype(str) | ||
| ) | ||
|
|
||
| df['pca'] = df['tfidf'].pipe(hero.pca) | ||
| df['pca'] = df['tokenized'].pipe(hero.tfidf).pipe(hero.normalize)pipe(hero.pca) | ||
|
|
||
| hero.scatterplot(df, 'pca', color='kmeans_labels', title="K-means BBC Sport news") | ||
| ``` | ||
|
|
@@ -180,7 +183,7 @@ Remove all types of brackets and their content. | |
|
|
||
| ```python | ||
| >>> s = hero.remove_brackets(s) | ||
| >>> s | ||
| >>> s | ||
| 0 This sèntencé needs to be cleaned! | ||
| dtype: object | ||
| ``` | ||
|
|
@@ -189,7 +192,7 @@ Remove diacritics. | |
|
|
||
| ```python | ||
| >>> s = hero.remove_diacritics(s) | ||
| >>> s | ||
| >>> s | ||
| 0 This sentence needs to be cleaned! | ||
| dtype: object | ||
| ``` | ||
|
|
@@ -198,7 +201,7 @@ Remove punctuation. | |
|
|
||
| ```python | ||
| >>> s = hero.remove_punctuation(s) | ||
| >>> s | ||
| >>> s | ||
| 0 This sentence needs to be cleaned | ||
| dtype: object | ||
| ``` | ||
|
|
@@ -207,7 +210,7 @@ Remove extra white-spaces. | |
|
|
||
| ```python | ||
| >>> s = hero.remove_whitespace(s) | ||
| >>> s | ||
| >>> s | ||
| 0 This sentence needs to be cleaned | ||
| dtype: object | ||
| ``` | ||
|
|
@@ -217,7 +220,16 @@ Sometimes we also want to get rid of stop-words. | |
| ```python | ||
| >>> s = hero.remove_stopwords(s) | ||
| >>> s | ||
| 0 This sentence needs cleaned | ||
| 0 This sentence needs cleaned | ||
| dtype: object | ||
| ``` | ||
|
|
||
| There is also the option to clean the text automatically by calling the "clean"-function instead of doing it step by step. | ||
| ```python | ||
| >>> text = "This sèntencé (123 /) needs to [OK!] be cleaned! " | ||
| >>> s = pd.Series(text) | ||
| >>> hero.clean(s) | ||
| 0 sentence needs cleaned | ||
| dtype: object | ||
| ``` | ||
|
|
||
|
|
@@ -243,9 +255,12 @@ Full documentation: [nlp](https://texthero.org/docs/api-nlp) | |
| **Scope:** map text data into vectors and do dimensionality reduction. | ||
|
|
||
| Supported **representation** algorithms: | ||
| 1. Term frequency (`count`) | ||
| 1. counting terms (`count`) | ||
| 1. Term frequency (`term_frequency`) | ||
| 1. Term frequency-inverse document frequency (`tfidf`) | ||
|
|
||
| For the "representation" functions it is strongly recommended to tokenize the input series first with the `hero.tokenize(s)` function from the texthero library. | ||
|
|
||
| Supported **clustering** algorithms: | ||
| 1. K-means (`kmeans`) | ||
| 1. Density-Based Spatial Clustering of Applications with Noise (`dbscan`) | ||
|
|
@@ -268,6 +283,18 @@ Supported functions: | |
|
|
||
| Full documentation: [visualization](https://texthero.org/docs/api-visualization) | ||
|
|
||
| <h2 align="center">Pandas Typing</h2> | ||
|
|
||
| What is pandas typing? Each category of functions, which are defined above, accepts a different type of pandas series or a pandas dataframe. Those are explained here. These types will in general improve the efficiency of the different algorithms as they are especially designed for those. | ||
|
|
||
| For the first step you don't need to worry too much about them, because, if you use a typical texthero pipeline, the functions will have the right input and output types. The *typical* hero pipeline will: | ||
|
mk2510 marked this conversation as resolved.
Outdated
|
||
| - first "clean" the text with any preprocessing function, e. g. `clean`, | ||
|
mk2510 marked this conversation as resolved.
Outdated
|
||
| - then perform a NLP function to categorise the text, e. g. `tokenize` and `tfidf` | ||
| - analyse or display the series with the representation function or the clustering functions, e. g. `kmeans` | ||
| - do a dimensionality reduction to display them better in 2D or 3D, e. g. `pca` | ||
|
|
||
| If your pipeline will differ, you might want to check out the tutorial on series types to understand which type of pandas objects you will get returned and which types will be accepted by the functions. | ||
|
mk2510 marked this conversation as resolved.
Outdated
|
||
|
|
||
| <h2 align="center">FAQ</h2> | ||
|
|
||
| <h5>Why Texthero</h5> | ||
|
|
@@ -295,7 +322,7 @@ The website will be soon moved from Docusaurus to Sphinx: read the [open issue t | |
|
|
||
| **Are you good at writing?** | ||
|
|
||
| Probably this is the most important piece missing now on Texthero: more tutorials and more "Getting Started" guide. | ||
| Probably this is the most important piece missing now on Texthero: more tutorials and more "Getting Started" guide. | ||
|
|
||
| If you are good at writing you can help us! Why don't you start by [Adding a FAQ page to the website](https://github.com/jbesomi/texthero/issues/41) or explain how to [create a custom pipeline](https://github.com/jbesomi/texthero/issues/38)? Need help? We are there for you. | ||
|
|
||
|
|
@@ -314,6 +341,8 @@ If you have just other questions or inquiry drop me a line at jonathanbesomi__AT | |
| - [bobfang1992](https://github.com/bobfang1992) | ||
| - [Ishan Arora](https://github.com/ishanarora04) | ||
| - [Vidya P](https://github.com/vidyap-xgboost) | ||
| - [Henri Froese](https://github.com/henrifroese) | ||
| - [Maximilian Krahn](https://github.com/mk2510) | ||
| - [Cedric Conol](https://github.com/cedricconol) | ||
| - [Rich Ramalho](https://github.com/richecr) | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.