Comments (2)
Hello, thank you for raising this issue.
Here is a script to create a "stop vector"
from sentence_transformers import SentenceTransformer
import numpy as np
# Use sentence model
trf_model = SentenceTransformer('LaBSE')
# Define stop words
stop_words = ['you', 'it', 'of', 'and', 'for', 'what', 'we', 'this']
# Vectorize stop words
stop_vectors = trf_model.encode(stop_words)
# Get vectors' average
stop_vector_avg = np.average(stop_vectors, axis=0).reshape(1, -1)
# Save average vector ("stop word vector")
np.save('test.npy', stop_vector_avg)
from tm2tb.
Thank you!
Will try this out!
from tm2tb.
Related Issues (18)
- PyPI package
- Add additional (and smaller) language agnostic models HOT 1
- 'Tm2Tb' object has no attribute 'get_ngrams' HOT 1
- Truncated results HOT 2
- What is the approach? HOT 1
- Value error when max_stopword_similarity too low in extract_terms method
- Local dictionaries HOT 1
- Loading all SpaCy models slows down extraction
- How to create stops_embeddings data for more languages? HOT 1
- solve Colab requirements conflicts
- App doesn't seem to work - missing 'uploads' directory as well HOT 3
- Improve bitext reader
- update ranks on README
- How to get an Azure key?
- Biterm extractor fails with "IndexError: list index out of range"
- Feature idea: make it work with non-aligned bilingual data
- Would sentence alignment be in the scope of the module?
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 tm2tb.