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)
- Model fails to train with Linux and Keras 3.3.2 HOT 9
- Compatible with .ogg format HOT 2
- keras autocast casts numpy int types to float HOT 2
- bug in TF _keepdims? HOT 3
- keras.ops.cross doesn't propagate input sizes HOT 1
- GSOC '24 Project? HOT 1
- Dice loss - incorrect HOT 1
- The loss becomes neagative from positive values dring taining loop HOT 3
- Unusual behavior of `predict` for JAX backend HOT 17
- Layernorm not supporting axis [-2, 3] HOT 2
- LSTM layer with dropout does not use fast CuDNN implementation in Keras 3 HOT 1
- RaggedTensor HOT 4
- [Proposal] API tuning for use_cudnn in LSTM/other layers HOT 5
- The torch backend for jnp.cholesky should use torch.linalg.cholesky, not torch.cholesky HOT 1
- Numeric diff of BatchNormalization layer when migrate from Keras2 to keras3 HOT 5
- How to save Scikit-Learn-Keras Model into a Persistence File (pickle/hd5/json/yaml) with Keras 3 HOT 12
- loss and val_loss decreasing HOT 1
- StringLookup does not return expected dtype for multi_hot
- TypeError: Could not locate class 'adam'. Make sure custom classes are decorated with `@keras.saving.register_keras_serializable()` HOT 1
- Shape error for some use cases of `binary_crossentropy`. HOT 2
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.