<jupyter_start><jupyter_text>Install Vector HubFeel free to contact the vector hub dev team at <EMAIL> for support<jupyter_code>!pip install vectorhub[all]<jupyter_output><empty_output><jupyter_text>Text2Vec - Turn Text to Vectors  TFHub Models!pip install vectorhub[encoders-text-tfhub]  BERT2VecBidirectional Encoder Representations from Transformers<jupyter_code>from vectorhub.encoders.text.tfhub import Bert2Vec
model = Bert2Vec()
vector = model.encode("I enjoy taking long walks along the beach with my dog.")
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Albert2VecA Lite Bert<jupyter_code>from vectorhub.encoders.text.tfhub import Albert2Vec
model = Albert2Vec()
vector = model.encode("I enjoy taking long walks along the beach with my dog.")
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>LaBSE2VecLanguage-agnostic BERT Sentence Embedding<jupyter_code>from vectorhub.encoders.text.tfhub import LaBSE2Vec
model = LaBSE2Vec()
vector = model.encode("I enjoy taking long walks along the beach with my dog.")
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>USE2VecUniversal Sentence Encoder<jupyter_code>from vectorhub.encoders.text.tfhub import USE2Vec
model = USE2Vec()
vector = model.encode("I enjoy taking long walks along the beach with my dog.")
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>USEMulti2VecUniversal Sentence Encoder Multilingual<jupyter_code>from vectorhub.encoders.text.tfhub import USEMulti2Vec
model = USEMulti2Vec()
vector = model.encode("I enjoy taking long walks along the beach with my dog.")
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>USELite2Vec (Requires disabling tf2)Universal Sentence Encoder Lite (uncomment to run, the rest of the code might not work though)<jupyter_code># from vectorhub.encoders.text.tfhub import USELite2Vec
# model = USELite2Vec()
# model.init()
# vector = model.encode("I enjoy taking long walks along the beach with my dog.")
# len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Transformers ModelsNLP Models made by hugging faceFor Pytorch!pip install vectorhub[encoders-text-torch-transformers]For Tensorflow!pip install vectorhub[encoders-text-tf-transformers]  PyTorch Bert<jupyter_code>from vectorhub.encoders.text.torch_transformers import Transformer2Vec
model = Transformer2Vec('bert-base-uncased')
vector = model.encode("I enjoy taking long walks along the beach with my dog.")
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Tensorflow Bert<jupyter_code>from vectorhub.encoders.text.tf_transformers import TFTransformer2Vec
model = TFTransformer2Vec('bert-base-uncased')
vector = model.encode("I enjoy taking long walks along the beach with my dog.")
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Image2Vec - Turn Image to Vectors  TFHub Models!pip install vectorhub[encoders-image-tfhub]  BIT2VecBiT - Big Transfer, General Visual Representation Learning<jupyter_code>from vectorhub.encoders.image.tfhub import BitSmall2Vec
model = BitSmall2Vec()
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
vector = model.encode(sample)
len(vector), vector[:10]
from vectorhub.encoders.image.tfhub import BitMedium2Vec
model = BitMedium2Vec()
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
vector = model.encode(sample)
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Inception2VecInception<jupyter_code>from vectorhub.encoders.image.tfhub import InceptionV12Vec
model = InceptionV12Vec()
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
vector = model.encode(sample)
len(vector), vector[:10]
from vectorhub.encoders.image.tfhub import InceptionV22Vec
model = InceptionV22Vec()
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
vector = model.encode(sample)
len(vector), vector[:10]
from vectorhub.encoders.image.tfhub import InceptionV32Vec
model = InceptionV32Vec()
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
vector = model.encode(sample)
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Resnet2VecResnet<jupyter_code>from vectorhub.encoders.image.tfhub import ResnetV12Vec
model = ResnetV12Vec()
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
vector = model.encode(sample)
len(vector), vector[:10]
from vectorhub.encoders.image.tfhub import ResnetV22Vec
model = ResnetV22Vec()
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
vector = model.encode(sample)
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>InceptionResnet2VecInception Resnet<jupyter_code>from vectorhub.encoders.image.tfhub import InceptionResnet2Vec
model = InceptionResnet2Vec()
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
vector = model.encode(sample)
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>MobileNet2VecMobileNet<jupyter_code>from vectorhub.encoders.image.tfhub import MobileNetV12Vec
model = MobileNetV12Vec('https://tfhub.dev/google/imagenet/mobilenet_v1_025_224/feature_vector/4', image_dimensions=224)
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
vector = model.encode(sample)
len(vector), vector[:10]
from vectorhub.encoders.image.tfhub import MobileNetV22Vec
model = MobileNetV22Vec()
sample = model.read('https://getvectorai.com/assets/hub-logo-with-text.png')
vector = model.encode(sample)
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Audio2Vec - Turn Audio to Vectors  TFHub Models!pip install vectorhub[encoders-audio-tfhub]  SpeechEmbedding2VecSpeech Embedding<jupyter_code>from vectorhub.encoders.audio.tfhub import SpeechEmbedding2Vec
model = SpeechEmbedding2Vec()
sample = model.read('https://vecsearch-bucket.s3.us-east-2.amazonaws.com/voices/common_voice_en_2.wav')
vector = model.encode(sample)
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Trill2VecTriplet Loss Network<jupyter_code>from vectorhub.encoders.audio.tfhub import Trill2Vec
model = Trill2Vec()
sample = model.read('https://vecsearch-bucket.s3.us-east-2.amazonaws.com/voices/common_voice_en_2.wav')
vector = model.encode(sample)
len(vector), vector[:10]
from vectorhub.encoders.audio.tfhub import TrillDistilled2Vec
model = TrillDistilled2Vec()
sample = model.read('https://vecsearch-bucket.s3.us-east-2.amazonaws.com/voices/common_voice_en_2.wav')
vector = model.encode(sample)
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Vggish2VecVggish<jupyter_code>from vectorhub.encoders.audio.tfhub import Vggish2Vec
model = Vggish2Vec()
sample = model.read('https://vecsearch-bucket.s3.us-east-2.amazonaws.com/voices/common_voice_en_2.wav')
vector = model.encode(sample)
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Yamnet2VecYamnet<jupyter_code>from vectorhub.encoders.audio.tfhub import Yamnet2Vec
model = Yamnet2Vec()
sample = model.read('https://vecsearch-bucket.s3.us-east-2.amazonaws.com/voices/common_voice_en_2.wav')
vector = model.encode(sample)
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>Pytorch Fairseq Models!pip install vectorhub[encoders-audio-pytorch]  Wav2VecWav2Vec 2.0<jupyter_code>from vectorhub.encoders.audio.pytorch import Wav2Vec
model = Wav2Vec()
sample = model.read('https://vecsearch-bucket.s3.us-east-2.amazonaws.com/voices/common_voice_en_2.wav')
vector = model.encode(sample)
len(vector), vector[:10]<jupyter_output><empty_output><jupyter_text>TextText2Vec - Turn 2 Different Type of Text to vectors. E.g. Question Answering  QA TFHub Models!pip install vectorhub[encoders-text-tfhub]  USEQA2VecUnviersal Sentence Encoder Question Answering<jupyter_code>from vectorhub.bi_encoders.text_text.tfhub import USEQA2Vec
model = USEQA2Vec()
q_vector = model.encode_question('How is the weather today?')
a_vector = model.encode_answer('The weather is great today.')
len(q_vector), q_vector[:10], len(a_vector), a_vector[:10]<jupyter_output><empty_output><jupyter_text>USEMultieQA2VecUnviersal Sentence Encoder Mulitlingual Question Answering<jupyter_code>from vectorhub.bi_encoders.text_text.tfhub import USEMultiQA2Vec
model = USEMultiQA2Vec()
q_vector = model.encode_question('How is the weather today?')
a_vector = model.encode_answer('The weather is great today.')
len(q_vector), q_vector[:10], len(a_vector), a_vector[:10]<jupyter_output><empty_output><jupyter_text>LAReQA2VecLanguage-agnostic Question Answering model for retrieving answers from a multilingual candidate pool<jupyter_code>from vectorhub.bi_encoders.text_text.tfhub import LAReQA2Vec
model = LAReQA2Vec()
q_vector = model.encode_question('How is the weather today?')
a_vector = model.encode_answer('The weather is great today.')
len(q_vector), q_vector[:10], len(a_vector), a_vector[:10]<jupyter_output><empty_output><jupyter_text>Pytorch Transformers  DPR2Vec - By Facebook Dense Passage Retrieval<jupyter_code>from vectorhub.bi_encoders.text_text.torch_transformers import DPR2Vec
model = DPR2Vec()
q_vector = model.encode_question('How is the weather today?')
a_vector = model.encode_answer('The weather is great today.')
len(q_vector), q_vector[:10], len(a_vector), a_vector[:10]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11639589568191534, 'fraction_numerical': 0.020521590423257803, 'mean_word_length': 8.209645669291339, 'pattern_counts': {'":': 0, '<': 94, '<?xml version=': 0, '>': 94, 'https://': 17, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '23', 'dir': 'jupyter-structured-clean-dedup', 'id': '204196', 'license': 'Apache-2.0', 'n_tokens_mistral': 3306, 'n_tokens_neox': 3229, 'n_words': 572, 'path': 'examples/Quickstart.ipynb', 'repo_name': 'tidpr/vectorhub', 'size': '9360'}