jev2-legal / README.md
bwang0911's picture
Add new SentenceTransformer model.
488b547 verified
|
raw
history blame
35.2 kB
metadata
language:
  - en
tags:
  - sentence-transformers
  - sentence-similarity
  - feature-extraction
  - generated_from_trainer
  - dataset_size:9260
  - loss:MultipleNegativesRankingLoss
base_model: jinaai/jina-embeddings-v2-small-en
widget:
  - source_sentence: >

      If the adjudication of disappearance is made with respect to A, who was
      aboard a vessel which later sank, A is deemed to have died upon elapse of
      one year after the sinking accident.
    sentences:
      - >

        Article 31

        A person subject to a declaration of disappearance pursuant to the
        provisions of paragraph (1) of the preceding Article is deemed to have
        died when the period of time referred to in that paragraph ended, and a
        person subject to a declaration of disappearance pursuant to the
        provisions of paragraph (2) of that Article is deemed to have died when
        that danger had passed.

        Article 30

        (1) If it has been unclear for seven years whether an absentee is dead
        or alive, the family court may enter a declaration of disappearance at
        the request of an interested person.

        (2) The provisions of the preceding paragraph also apply if it has been
        unclear whether a person who has entered a war zone, was aboard a vessel
        that has sunk, or was otherwise exposed to a danger likely to result in
        a person's death is dead or alive, for one year after the war has ended,
        the vessel sank, or such other danger has passed..
      - >

        Article 9

        A juridical act performed by an adult ward is voidable;provided,
        however, that this does not apply to the purchase of daily necessities
        or to any other act involved in day-to-day life..
      - >

        Article 97

        (1) A manifestation of intention becomes effective at the time notice
        thereof reaches the other party.

        (2) If the other party prevents notice of a manifestation of intention
        from reaching them without a legitimate reason, the notice is deemed to
        have reached that party at the time it would have normally reached them.

        (3) The effect of a manifestation of intention is not impaired even if
        the person making it dies, loses mental capacity, or becomes subject to
        restrictions on their legal capacity to act after having sent the
        notice..
  - source_sentence: >

      In cases where  a contract that creates a pledge upon a claim that cannot
      be assigned due to its nature has been made, such contract is void,
      regardless of whether the pledgee acted in good or bad faith regarding
      said non-assignability.
    sentences:
      - >

        Article 372

        The provisions of Article 296, Article 304

        and Article 351

        apply mutatis mutandis to mortgages.

        Article 304

        (1) A statutory lien may also be exercised against things including
        monies that the obligor is to receive as a result of the sale, lease or
        loss of, or damage to, the subject matter of the statutory
        lien;provided, however, that the holder of the statutory lien must
        attach the same before the payment or delivery of the monies or other
        thing.

        (2) The provisions of the preceding paragraph also apply to the
        consideration for real rights created by the obligor on the subject
        matter of the statutory lien..
      - >

        Article 636

        If the contractor delivers to the party ordering work of a content the
        subject matter of work that does not conform to the terms of the
        contract with respect to the kind or quality (in the case of the subject
        matter of work that is not required to be delivered, if the subject
        matter of work does not conform to the terms of the contract with
        respect to the kind or quality when the work is finished), the party
        ordering work may not demand cure of the non-conformity of performance,
        demand a reduction of the remuneration, claim compensation for loss or
        damage, or cancel the contract, on the grounds of the non-conformity
        caused by the nature of the materials that the party ordering work has
        provided or any instructions that the relevant party has given;provided,
        however, that this does not apply if the contractor knew that the
        materials or instructions were inappropriate but did not notify the
        ordering party of this..
      - >

        Article 343

        A thing that cannot be transferred to another person may not be made the
        subject of a pledge..
  - source_sentence: >

      If a mortgage creation contract has the agreement of the mortgagee and of
      the mortgagor that has ownership of the subject matter of the mortgage, it
      will be effective even if it is not in writing and there is no
      registration of its creation.
    sentences:
      - >

        Article 176

        The creation and transfer of a real right becomes effective solely by
        the manifestations of intention of the parties.

        Article 177

        Acquisitions of, losses of and changes in real rights on immovables may
        not be duly asserted against any third parties, unless the same are
        registered pursuant to the applicable provisions of the Real Property
        Registration Act (Act No. 123 of 2004) and other laws regarding
        registration..
      - >

        Article 370

        A mortgage extends to the things that form an integral part of the
        immovables that are the subject matter of the mortgage (hereinafter
        referred to as "mortgaged immovables") except for buildings on the
        mortgaged land; provided, however, that this does not apply if the act
        establishing the mortgage provides otherwise or the rescission of
        fraudulent act may be demanded as prescribed in Article 424, paragraph
        (3) with regard to the act of the obligor..
      - >

        Article 335

        (1) Holders of general statutory liens cannot be paid out of immovables
        unless they are first paid out of property other than immovables and a
        claim that is not satisfied remains.

        (2) With respect to immovables, holders of general statutory liens must
        first be paid out of those that are not the subject matters of special
        security.

        (3) If holders of general statutory liens fail to participate in
        distributions in accordance with the provisions of the preceding two
        paragraphs, they may not exercise their statutory liens against
        registered third parties with respect to amounts that would have been
        paid to them if they had participated in the distribution.

        (4) The provisions of the preceding three paragraphs do not apply if the
        proceeds of immovables are distributed prior to the proceeds of assets
        other than immovables, or if the proceeds of immovables that are the
        subject matter of a special security are distributed prior to the
        proceeds of other immovables..
  - source_sentence: >

      In cases where any defect in the installation or preservation of any
      structure on land caused damages to A,if B who possesses such structure
      shall be liable to compensate for those damages, the owner must compensate
      for the damages too when B has no financial resources.
    sentences:
      - >

        Article 192 A person that commences the possession of movables
        peacefully and openly by a transactional act acquires the rights that
        are exercised with respect to the movables immediately if the person
        possesses it in good faith and without negligence.

        Article 193 In the cases provided for in the preceding Article, if the
        possessed thing constitutes stolen or lost property, the victim or the
        person that lost the thing may demand the return of that thing from the
        possessor within two years from the time of the loss or theft.
      - >

        Article 717

        (1) If a defect in the installation or preservation of a structure on
        land causes damage to another person, the possessor of that structure is
        liable to the person incurring damage to compensate for the
        damage;provided, however, that if the possessor has exercised the
        necessary care to prevent the damage, the owner must compensate for the
        damage.

        (2) The provisions of the preceding paragraph apply mutatis mutandis if
        there is a defect in the planting or supporting of bamboo or trees.

        (3) In the cases referred to in the preceding two paragraphs, if there
        is another person that is liable for the cause of the damage, the
        possessor or owner may exercise their right to reimbursement against
        that person..
      - >

        Article 587-2

        (1) Notwithstanding the provisions of the preceding Article, a loan for
        consumption made in writing becomes effective when a first party
        promises to deliver money or any other thing and a second party promises
        to return a thing of the same type, quality, and quantity as the thing
        delivered.

        (2) The borrower of a loan for consumption made in writing may cancel
        the contract until the borrower receives the money or other thing from
        the lender. In such a case, if the lender sustains any damage from the
        cancellation of the contract, the lender may claim compensation
        therefor.

        (3) A loan for consumption made in writing ceases to be effective if
        either of the parties receives an order commencing bankruptcy
        proceedings before the borrower receives the thing such as money from
        the lender.

        (4) If a loan for consumption is made by means of an electronic or
        magnetic record in which its content is recorded, the loan for
        consumption is deemed to have been made in writing, and the provisions
        of the preceding three paragraphs apply thereto..
  - source_sentence: >

      In cases where real rights do not require requirements of perfection, the
      real rights that formed earlier in time take priority.
    sentences:
      - >

        Article 177

        Acquisitions of, losses of and changes in real rights on immovables may
        not be duly asserted against any third parties, unless the same are
        registered pursuant to the applicable provisions of the Real Property
        Registration Act (Act No. 123 of 2004) and other laws regarding
        registration..
      - >

        Article 445

        Even if one of the joint and several obligors is released from the
        obligation or the prescription period expires for one of the joint and
        several obligors, other joint and several obligors may exercise the
        right to reimbursement referred to in Article 442, paragraph (1) against
        that one joint and several obligor..
      - >

        Article 329

        (1) If there are competing general statutory liens, the order of
        priority follows the order set forth in each item of Article 306.

        (2) Ife there are competing a general statutory lien and a special
        statutory lien, the special statutory lien has priority over the general
        statutory lien;provided, however, that statutory liens on expenses for
        the common benefit have priority being effective against all obligees
        who benefit from the same.

        Article 306

        A person that has a claim arising from the causes set forth below has a
        statutory lien over the entire assets of the obligor:

        (i) expenses for the common benefit;

        (ii) an employer-employee relationship;

        (iii) funeral expenses; or

        (iv) the supply of daily necessaries.

        Article 330

        (1) If there are competing special statutory liens against the same
        movables, the order of priority follows the order set forth below.In
        this case, if there are two or more preservers with respect to the
        statutory liens for preservation of movables set forth in item (ii), a
        new preserver has priority over previous preservers:

        (i) statutory liens for leases of immovables, lodging at hotels and
        transportation;

        (ii) statutory liens for the preservation of movables; and

        (iii) statutory liens for the sale of movables, the supply of seeds and
        seedlings or fertilizer, agricultural labor and industrial labor.

        (2) In the cases referred to in the preceding paragraph, if a holder of
        a statutory lien ranked first knew at the time of acquiring the relevant
        claim of the existence of a holder of a statutory lien of the second or
        third rank, that holder may not exercise the relevant rights of priority
        against those persons. The same applies to the exercise against persons
        that have preserved things on behalf of the holder of a statutory lien
        of the first rank.

        (3) Regarding fruits, the first rank belongs to persons who engage in
        agricultural labor, the second rank belongs to persons that supply seeds
        and seedlings or fertilizer, and the third rank belongs to lessors of
        land..
datasets:
  - sentence-transformers/coliee
pipeline_tag: sentence-similarity
library_name: sentence-transformers

SentenceTransformer based on jinaai/jina-embeddings-v2-small-en

This is a sentence-transformers model finetuned from jinaai/jina-embeddings-v2-small-en on the coliee dataset. It maps sentences & paragraphs to a 512-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: jinaai/jina-embeddings-v2-small-en
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 512 tokens
  • Similarity Function: Cosine Similarity
  • Training Dataset:
  • Language: en

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: JinaBertModel 
  (1): Pooling({'word_embedding_dimension': 512, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load this model and run inference.

from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("bwang0911/jev2-legal")
# Run inference
sentences = [
    '\nIn cases where real rights do not require requirements of perfection, the real rights that formed earlier in time take priority.\n',
    '\nArticle 329\n(1) If there are competing general statutory liens, the order of priority follows the order set forth in each item of Article 306.\n(2) Ife there are competing a general statutory lien and a special statutory lien, the special statutory lien has priority over the general statutory lien;provided, however, that statutory liens on expenses for the common benefit have priority being effective against all obligees who benefit from the same.\nArticle 306\nA person that has a claim arising from the causes set forth below has a statutory lien over the entire assets of the obligor:\n(i) expenses for the common benefit;\n(ii) an employer-employee relationship;\n(iii) funeral expenses; or\n(iv) the supply of daily necessaries.\nArticle 330\n(1) If there are competing special statutory liens against the same movables, the order of priority follows the order set forth below.In this case, if there are two or more preservers with respect to the statutory liens for preservation of movables set forth in item (ii), a new preserver has priority over previous preservers:\n(i) statutory liens for leases of immovables, lodging at hotels and transportation;\n(ii) statutory liens for the preservation of movables; and\n(iii) statutory liens for the sale of movables, the supply of seeds and seedlings or fertilizer, agricultural labor and industrial labor.\n(2) In the cases referred to in the preceding paragraph, if a holder of a statutory lien ranked first knew at the time of acquiring the relevant claim of the existence of a holder of a statutory lien of the second or third rank, that holder may not exercise the relevant rights of priority against those persons. The same applies to the exercise against persons that have preserved things on behalf of the holder of a statutory lien of the first rank.\n(3) Regarding fruits, the first rank belongs to persons who engage in agricultural labor, the second rank belongs to persons that supply seeds and seedlings or fertilizer, and the third rank belongs to lessors of land..\n',
    '\nArticle 177\nAcquisitions of, losses of and changes in real rights on immovables may not be duly asserted against any third parties, unless the same are registered pursuant to the applicable provisions of the Real Property Registration Act (Act No. 123 of 2004) and other laws regarding registration..\n',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 512]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Training Details

Training Dataset

coliee

  • Dataset: coliee at d90012e
  • Size: 9,260 training samples
  • Columns: anchor, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    anchor positive negative
    type string string string
    details
    • min: 10 tokens
    • mean: 46.44 tokens
    • max: 137 tokens
    • min: 22 tokens
    • mean: 117.11 tokens
    • max: 441 tokens
    • min: 14 tokens
    • mean: 123.64 tokens
    • max: 405 tokens
  • Samples:
    anchor positive negative

    Actions for maintenance of possession must be brought during the disturbance.

    Article 201
    (1) An action for maintenance of possession must be filed during the obstruction or within one year after the obstruction stops;provided, however, that if the possessed thing has been damaged due to construction work and either one year has passed from the time when the construction was started or the construction has been completed, the action may not be filed.
    (2) An action for preservation of possession may be filed so long as the danger of obstruction exists.In this case, the provisions of the proviso to the preceding paragraph apply mutatis mutandis if the possessed thing is likely to be damaged by the construction work.
    (3) An action for recovery of possession must be filed within one year from the time when a possessor was forcibly dispossessed..

    Article 246
    (1) If a person (hereinafter in this Article referred to as "processor") adds labor to another person's movables, the ownership of the processed thing belongs to the owner of the material; provided, however, that if the value derived from the work significantly exceeds the value of the material, the processor acquires ownership of the processed thing.
    (2) In the cases prescribed in the preceding paragraph, if the processor provides a portion of the materials, the processor acquires ownership of the processed thing only if the value of provided materials added to the value derived from the labor exceeds the value of the other person's materials.
    Article 91
    If a party to a juridical act manifests an intention that is inconsistent with the provisions of laws and regulations that are not related to public policy, that intention prevails..

    In the case where (A) loses his/her capacity to act after the dispatch of the notice of an offer of a contract to (B), who is a person at a distance, even if (B) knows such fact, the offer of the contract shall become effective.

    Article 526
    If an offeror dies, comes to be in a constant state wherein the offeror lacks mental capacity, or becomes subject to restrictions on legal capacity to act after issuing notice of the offer, and the offeror has manifested the intention not to make the offer effective should any of these facts occur, or the other party comes to know that any of these facts has occurred before issuing a notice of acceptance, that offer is not effective..

    Article 301
    An obligor may demand that a right of retention be terminated by providing a reasonable security.
    Article 533
    A party to a bilateral contract may refuse to perform that party's own obligation until the other party tenders the performance of that other party's obligation (including the performance of an obligation to compensate for loss or damage in lieu of the performance of an obligation);provided, however, that this does not apply if the obligation of the other party is not yet due..

    Statutory liens for employer-employee relationships secure salaries paid regularly, but do not secure retirement payments that should be paid when the employee retires.

    Article 308
    Statutory liens for employer-employee relationships exist with respect to salaries and other claims that arise from the employer-employee relationship between the obligor and the employee..

    Article 632
    A contract for work become effective when one of the parties promises to complete work and the other party promises to pay remuneration for the outcome of the work..
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 64
  • learning_rate: 2e-05
  • warmup_ratio: 0.1
  • fp16: True
  • batch_sampler: no_duplicates

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 64
  • per_device_eval_batch_size: 8
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 2e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 3
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.1
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: True
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: False
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • dispatch_batches: None
  • split_batches: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.1.1
  • Transformers: 4.45.2
  • PyTorch: 2.5.1+cu124
  • Accelerate: 1.1.0
  • Datasets: 3.1.0
  • Tokenizers: 0.20.3

Citation

BibTeX

Sentence Transformers

@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}

MultipleNegativesRankingLoss

@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply},
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}