Sentence Similarity
PyTorch
Safetensors
sentence-transformers
Transformers
Vietnamese
generic
roberta
feature-extraction
Instructions to use bkai-foundation-models/vietnamese-bi-encoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use bkai-foundation-models/vietnamese-bi-encoder with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("bkai-foundation-models/vietnamese-bi-encoder") sentences = [ "Làm thế nào Đại học Bách khoa Hà Nội thu hút sinh viên quốc tế?", "Đại học Bách khoa Hà Nội đã phát triển các chương trình đào tạo bằng tiếng Anh để làm cho việc học tại đây dễ dàng hơn cho sinh viên quốc tế.", "Môi trường học tập đa dạng và sự hỗ trợ đầy đủ cho sinh viên quốc tế tại Đại học Bách khoa Hà Nội giúp họ thích nghi nhanh chóng.", "Hà Nội có khí hậu mát mẻ vào mùa thu.", "Các món ăn ở Hà Nội rất ngon và đa dạng." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [5, 5] - Transformers
How to use bkai-foundation-models/vietnamese-bi-encoder with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("bkai-foundation-models/vietnamese-bi-encoder") model = AutoModel.from_pretrained("bkai-foundation-models/vietnamese-bi-encoder") - Notebooks
- Google Colab
- Kaggle
Xin tips minning hard negative
#4
by bravend - opened
Mình đang muốn làm một model tương tự nhưng với dữ liệu news/wiki. Mình đã thử dùng một số phương pháp sau:
- Chỉ sử dụng positives làm in-batch-negative: score tăng đến một ngưỡng rồi không tăng nữa, dù có thêm nhiều dữ liệu vào
- in-batch-negative thêm hard-negative được mining bằng BM25, mình có thử lấy random 1 bài trong các top (1-10), (20-30), (40-60) làm hard-negative nhưng mà kết quả lại tụt thảm so với chỉ dùng in-batch-negative.
Mình muốn tham khảo cách làm của nhóm. Cám ơn nhóm đã tạo ra một pre-train rất hữu ích !