Views
No views yet
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
(1): Pooling({'embedding_dimension': 384, 'pooling_mode': 'cls', 'include_prompt': True})
(2): Normalize({})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("vivekkopthsd/fiqa-retriever-bge-small")
5# Run inference
6queries = [
7 'Stock grant, taxes, and the IRS',
8]
9documents = [
10 "I went through this too. There's a safe-harbor provision. If you prepay as estimated tax payments, 110% of your previous year's tax liability, there's no penalty for underpayment of the big liquidity-event tax liability. https://www.irs.gov/publications/p17/ch04.html That's with the feds. Your state may have different rules. You would be very wise indeed to hire an accountant to prepare your return this year. If I were you I'd ask your company's CFO or finance chief to suggest somebody. Congratulations, by the way.",
11 "The value of the asset doesn't change just because of the exchange rate change. If a thing (valued in USD) costs USD $1 and USD $1 = CAN $1 (so the thing is also valued CAN $1) today and tomorrow CAN $1 worth USD $0.5 - the thing will continue being worth USD $1. If the thing is valued in CAN $, after the exchange rate change, the thing will be worth USD $2, but will still be valued CAN $1. What you're talking about is price quotes, not value. Price quotes will very quickly reach the value, since any deviation will be used by the traders to make profits on arbitrage. And algo-traders will make it happen much quicker than you can even notice the arbitrage existence.",
12 '"Things I would specifically draw your attention to: the contract typically allows for an ""option"" to purchase; it does not typically compel purchase, although this is seen the purchase price is negotiated before anything gets signed the option to buy is typically available to the renter for the period of the lease contract (ie., if it\'s a 12 month contract the renter can opt to buy at any time in that 12 months) the amount of rent paid over time that will be applied to the purchase price is negotiated up-front before anything gets signed rent is paid at a slight premium (as Joe notes, if the rent should be $1000 per month, expect to pay $1200 per month) if the renter walks away they walk away empty handed; they do not get back the premium Having said all that - it\'s a contract negotiated between renter and seller and all of this is negotiable. See also, ehow for a good overview."',
13]
14query_embeddings = model.encode_query(queries)
15document_embeddings = model.encode_document(documents)
16print(query_embeddings.shape, document_embeddings.shape)
17# [1, 384] [3, 384]
18
19# Get the similarity scores for the embeddings
20similarities = model.similarity(query_embeddings, document_embeddings)
21print(similarities)
22# tensor([[ 0.4181, 0.0066, -0.0466]])fiqa-testInformationRetrievalEvaluator| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.3858 |
| cosine_accuracy@3 | 0.5324 |
| cosine_accuracy@5 | 0.5818 |
| cosine_accuracy@10 | 0.6667 |
| cosine_precision@1 | 0.3858 |
| cosine_precision@3 | 0.2382 |
| cosine_precision@5 | 0.1728 |
| cosine_precision@10 | 0.11 |
| cosine_recall@1 | 0.1952 |
| cosine_recall@3 | 0.321 |
| cosine_recall@5 | 0.3716 |
| cosine_recall@10 | 0.4555 |
| cosine_ndcg@10 | 0.3923 |
| cosine_mrr@10 | 0.4731 |
| cosine_map@100 | 0.3345 |
sentence_0 and sentence_1| sentence_0 | sentence_1 | |
|---|---|---|
| type | string | string |
| modality | text | text |
| details |
|
|
| sentence_0 | sentence_1 |
|---|---|
How come I can't sell short certain stocks? My broker says “no shares are available” | In finance, short selling (also known as shorting or going short) is the practice of selling assets, usually securities, that have been borrowed from a third party (usually a broker) with the intention of buying identical assets back at a later date to return to the lender. Remember your broker has to borrow it from somewhere, other clients or if they hold those specific stocks themselves. So if it isn't possible for them to lend you those stocks, they wouldn't. High P/E stocks would find more sellers than buyers, and if the broker has to deliver them, it would be a nightmare for him to deliver all those stocks, which he had lent you(others) back to whom he had borrowed from, as well as to people who had gone long(buy) when you went short(sell). And if every body is selling there is going to be a dearth of stocks to be borrowed from as everybody around is selling instead of buying. |
How to choose a company for an IRA? | "I use TIAA-Cref for my 403(b) and Fidelity for my solo 401(k) and IRAs. I have previously used Vanguard and have also used other discount brokers for my IRA. All of these companies will charge you nothing for an IRA, so there's really no point in comparing cost in that respect. They are all the ""cheapest"" in this respect. Each one will allow you to purchase their mutual funds and those of their partners for free. They will charge you some kind of fee to invest in mutual funds of their competitors (like $35 or something). So the real question is this: which of these institutions offers the best mutual and index funds. While they are not the worst out there, you will find that TIAA-Cref are dominated by both Vanguard and Fidelity. The latter two offer far more and larger funds and their funds will always have lower expense ratios than their TIAA-Cref equivalent. If I could take my money out of TIAA-Cref and put it in Fidelity, I'd do so right now. BTW, you may or may not want t... |
Why are currency forwards needed? | e.g. a European company has to pay 1 million USD exactly one year from now While that is theoretically possible, that is not a very common case. Mostly likely if they had to make a 1 million USD payment a year from now and they had the cash on hand they would be able to just make the payment today. A more common scenario for currency forwards is for investment hedging. Say that European company wants to buy into a mutual fund of some sort, say FUSEX. That is a USD based mutual fund. You can't buy into it directly with Euros. So if the company wants to buy into the fund they would need to convert their Euros to to USD. But now they have an extra risk parameter. They are not just exposed to the fluctuations of the fund, they are also exposed to the fluctuations of the currency market. Perhaps that fund will make a killing, but the exchange rate will tank and they will lose all their gains. By creating a forward to hedge their currency exposure risk they do not face this risk (flip side... |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false,
5 "directions": [
6 "query_to_doc"
7 ],
8 "partition_mode": "joint",
9 "hardness_mode": null,
10 "hardness_strength": 0.0
11}per_device_train_batch_size: 256fp16: Trueper_device_eval_batch_size: 256multi_dataset_batch_sampler: round_robinper_device_train_batch_size: 256num_train_epochs: 3max_steps: -1learning_rate: 5e-05lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 1average_tokens_across_devices: Truemax_grad_norm: 1label_smoothing_factor: 0.0bf16: Falsefp16: Truebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 256prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Falseignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Noneremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonewarmup_ratio: Nonelocal_rank: -1prompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robinrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | fiqa-test_cosine_ndcg@10 |
|---|---|---|
| -1 | -1 | 0.3923 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{oord2019representationlearningcontrastivepredictive,
2 title={Representation Learning with Contrastive Predictive Coding},
3 author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
4 year={2019},
5 eprint={1807.03748},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/1807.03748},
9}