Comments (2)
Scikit-learn provides great utilities for text preprocessing/vectorizing, and Keras does not aim at reimplementing any of that. Keras and Scikit-learn are already compatible since both work with the same numpy arrays, so no need for further integration.
The functionality in preprocessing.text takes care of what Keras needs that scikit-learn doesn't do: for now mostly working with sequences (lists of word indexes in a vocabulary, sorted by frequency in the vocabulary for convenience). This is relevant mostly for RNNs.
from keras.
from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer(max_features=max_words,binary=True)
vectorizer.fit(phrases)
sparse = vectorizer.transform(phrases)
X=[row.indices for row in sparse]
# ^^ sparse matrix to sequences
from keras.
Related Issues (20)
- Enable `integration_test/numerical_test.py` for CI
- possible bug? tf.math.tanh to replace tf.tanh HOT 7
- [Feature Request] Re-enable multi-output logs HOT 4
- [Feature Request] Keras ops.gradient function HOT 2
- can't run keras-nlp quickstart? HOT 1
- Custom Keras RNN with constants changes constants shape when saving HOT 3
- 'Functional' object has no attribute 'fit_generator' HOT 1
- TorchModuleWrapper default `get_config` creates non serializable objects HOT 2
- (feat) Implement the deprecated `ctc_decode` function in Keras v3 HOT 2
- Build in Keras3 Model will not build sub-layers HOT 3
- Backend-Agnostic Types HOT 13
- Cant get correct keras_nlp package from pip HOT 3
- Keras3 not working with Sparce Tensors HOT 1
- CompileMetrics.build should check y_pred.name instead of assigning None to output_names HOT 4
- inference changes from version < 3.0.5 to 3.0.5 and nightly HOT 2
- Bug in LayerNormalization when assigning axis to other than -1 while using a keras.utils.Sequence data generator HOT 3
- Explaination of variable dimensional input for tf.keras.layers.MultiHeadAttention
- Docs for Mixed precision training and the use of `LossScaleOptimizer` in custom loops with jax backend HOT 2
- [BUG] The implementation of TensorFlow optimizers for distributed training is incorrect HOT 2
- [BUG][all_reduce] INVALID_ARGUMENT: You must feed a value for placeholder tensor HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras.