Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Paper • 1908.10084 • Published • 15
How to use simonosgoode/nomic_embed_fine_tune_law_v3 with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("simonosgoode/nomic_embed_fine_tune_law_v3", trust_remote_code=True)
sentences = [
"cluster: SUMMARY: Eli Lilly Canada Inc. v. Novopharm Limited\nCourt (s) Database\nFederal Court Decisions\nDate\n2007-10-31\nNeutral citation\n2007 FC 1126\nFile numbers\nT-1048-07\nDecision Content\nDate: 20071031\nDocket: T-1048-07\nCitation: 2007 FC 1126\nToronto, Ontario, October 31, 2007\nPRESENT: The Honourable Justice Johanne Gauthier\nBETWEEN:\nELI LILLY CANADA INC., ELI LILLY AND COMPANY,\nELI LILLY COMPANY LIMITED and ELI LILLY SA\nPlaintiffs\n(Defendants by Counterclaim)\nand\nNOVOPHARM LIMITED\nDefendant\n(Plaintiff by Counterclaim)\nREASONS FOR ORDER AND ORDER\n[1] Novopharm appeals the Order of Prothonotary Tabib dated September 25, 2007 granting the plaintiffs’ motion for bifurcation of the issues of quantum from those of validity and infringement of the patent in suit pursuant to Rule 107 of the Federal Courts Rules, 1998, SOR/98-106. It is to be noted that Prothonotary Tabib is the Case Manager in this matter.\n[2] All the principles applicable to this appeal are well known. As the matter before Prothonotary Tabib did not involve a question vital to the final issue of the case, the Court should not intervene on appeal unless her decision was clearly wrong, “in the sense that the exercise of discretion was based upon a wrong principle or a misapprehension of the facts” (Z.I. Pompey Industrie v. ECU-Line N.V. [2003], 1 S.C.R. 450 at para. 461), Merck and Co. v. Apotex Inc. [2003], 30 C.P.R (4th) 40 (FCA); [2003] F.C.J. No. 1925 at para. 19). The principles or conditions for the making of an order pursuant to Rule 107 are also well established (see for example Apotex Inc. v. Bristol-Myers Squibb Co. 2003 F.C.A. 263, (2003) 26 C.P.R. (4th) 129 at para. 7); Illva Saronno S.p.A. v. Privilegiata Fabbrica Maraschino \"Excelsior\" (T.D.), [1998] F.C.J. No. 1500; Illva Saronno S.p.A. v. Privilegiata Fabbrica Maraschino, [2000] F.C.J. No. 170 at para 8; Merck & Co. et al. v. Brantford Chemicals Inc. [2004] F.C.J. No. 1704, 35 C.P.R. (4th) 4, aff’d [2005] F.C.J. No. 837, 39 C.P.R (4th) 524 (F.C.A.); Apotex Inc. v. Merck & Co. [2004] F.C.J. No. 1372 at para. 3). It is trite law that the applicant bears the burden of convincing the Court on a balance of probabilities that in light of the evidence and all of the circumstances of the case (including the nature of the claims, the conduct of the litigation, the issues and remedies sought), bifurcation or severance is more likely than not to result in the just, expeditious and least expensive determination of the proceeding on its merits.\n[3] That being said, having carefully considered all the arguments put forth by the parties on this appeal, the Court is not persuaded that Prothonotary Tabib made any error that warrants the Court’s intervention.\n[4] As mentioned at the hearing, given that time is of the essence here, the Court will not comment on each and every issue raised by Novopharm (such issues are summarised at paragraph 2 of the written representations). However, considering the importance given to the following issues at the hearing, it is worth noting specifically that the Court cannot agree with Novopharm that Prothonotary Tabib implicitly applied or assumed the existence of a presumption in favour of bifurcation in patent infringement cases, which had the effect of actually reversing the burden of proof so as to place it on the shoulders of Novopharm. There was evidence before Prothonotary Tabib dealing with bifurcation of quantum issues in cases involving patent infringement in the last fifteen years (such as the affidavits of Nancy Gallinger and of Alisha Meredith). Prothonotary Tabib expressly refers to Apotex Inc. v. Bristol-Myers Squibb Co. above; in that case, the Federal Court of Appeal agreed that “when an experienced specialist bar like the intellectual property bar commonly consents to the making of a bifurcation order, it is open to a judge to infer that, in general, such an order may well advance the just and expeditious resolution of claims”.\n[5] It is also absolutely clear from the decision that this was only one of many factors Prothonotary Tabib considered before making her order. Among many other things, she was satisfied based on the evidence before her, the pleadings, her knowledge of the history of the proceeding and the issues it involved, that not only would bifurcation likely have the advantage of speeding up the determination of the liability issues (which at this stage also involve novel questions of law particularly in respect of the section 8 counterclaim), but that bifurcation would also more likely than not avoid at least one side of the quantification exercise whatever the result of the trial on liability issues. (page 4 last sentence and page 6 and 7)\n[6] Evidently, the Prothonotary was satisfied that she did not require more specific evidence in respect of the number of days of discoveries or an exact quantification of the time and expenses that would be saved in order to determine whether this would necessarily result in a saving of time and money for the Court and the parties.\n[7] Novopharm says that this constitute an error of law as Prothonotary Tabib failed to heed the evidentiary requirements set out by the Federal Court of Appeal in Realsearch Inc. v. Valon Kone Brunette, 31 C.P.R. (4th) 101 (F.C.A.), [2004] 2 F.C.R. 514.\n[8] Like Prothonotary Tabib, the Court does not believe that Realsearch establishes a new condition or standard for the making of an order under Rule 107. As any party who has a burden of proof to meet, the applicant seeking such an order must provide sufficient evidence to enable the Court to come to a conclusion on the matter before it. The fact that there was no evidence dealing with the specific saving of time and money that would result from the bifurcation in the case before the Court in Realsearch was worth noting and was particularly significant because the bifurcation sought in that case was in respect of a question of law (claims construction). Such request was an unusual and a somewhat novel use of bifurcation pursuant to Rule 107. In such a case, the Court could not rely on experience or on an inference based on a consistent practice in respect of the bifurcation of quantum issues in similar cases or on knowledge acquired while case managing the matter. The situation is quite different here.\n[9] It is clear from her order that Prothonotary Tabib knew perfectly well that the applicant had to satisfy her on a balance of probabilities. She was fully aware of all the arguments raised by Novopharm in respect of the quality (or rather lack thereof) of the evidence before her. Still, she concluded on page 9 that on the whole, she was satisfied that she could reach a conclusion that severance is more likely than not to result in the just, expeditious and least expensive determination of the proceeding on its merits.\n[10] In fact, even if Novopharm had convinced that the Court that it should exercise its discretion de novo, the Court would ultimately have reached the same conclusion as Prothonotary Tabib.\nORDER\nTHIS COURT ORDERS that:\nThe appeal is dismissed with costs.\n“Johanne Gauthier”\nJudge\nFEDERAL COURT\nSOLICITORS OF RECORD\nDOCKET: T-1048-07\nSTYLE OF CAUSE: ELI LILLY CANADA INC. ET AL\nPlaintiffs\nand\nNOVOPHARM LIMITED Defendant\nPLACE OF HEARING: TORONTO, ONTARIO\nDATE OF HEARING: 29-OCT-2007\nREASONS FOR : Gauthier, J.\nDATED: 31-OCT-2007\nAPPEARANCES:\nMR. ANTHONY G. CREBER\nFOR THE PLAINTIFFS\nMR. JONATHAN STAINSBY\nMR. ANDY RADHAKANT\nMR. NEIL FINEBERG\nFOR THE DEFENDANT\nSOLICITORS OF RECORD:\nGOWLING LAFLEUR HENDERSON LLP\nBarristers & Solicitors\nOttawa, Ontario\nFOR THE PLAINTIFFS\nHEENAN BLAIKIE LLP\nLawyers\nToronto, Ontario\nFOR THE DEFENDANT\n",
"cluster: ANALYSIS: In analyzing the issue of whether the applicants were denied the right to counsel, the court carefully reviewed the transcript of the hearing and found that it did not support the applicants' allegations. The court noted that the applicants had been informed that their original lawyer, Philip U. Okpala, would not be attending the hearing and that they had been given the opportunity to request an adjournment, which was denied. The court also found that the Board Member had not pressured the applicants to proceed without counsel, but rather had given them the opportunity to decide whether to proceed with or without counsel. In analyzing the issue of whether the Board made capricious findings of fact, the court determined that the Board's conclusion that the police were unable to locate the perpetrator of the ticket incident and that the principal claimant did not pursue the matter further was reasonable and not made arbitrarily or irrationally.",
"cluster: SUMMARY: **(1) Facts**\n\nThe case before the court involves a patent dispute between Eli Lilly Canada Inc. and Novopharm Limited. Eli Lilly Canada Inc. had sought a motion to bifurcate the issues of quantum from those of validity and infringement of the patent in suit. Prothonotary Tabib granted the motion, and Novopharm Limited appealed the decision. The parties involved in the case had been litigating for some time, and the court was considering the appropriateness of bifurcation to speed up the determination of the liability issues and to avoid quantification exercises.\n\n**(2) Issue**\n\nThe issue before the court was whether Prothonotary Tabib erred in granting the motion to bifurcate the issues of quantum from those of validity and infringement of the patent in suit. Novopharm Limited argued that Prothonotary Tabib had made an error of law in granting the motion without sufficient evidence to support the decision. Specifically, Novopharm Limited argued that Prothonotary Tabib had failed to heed the evidentiary requirements set out by the Federal Court of Appeal in Realsearch Inc. v. Valon Kone Brunette.\n\n**(3) Rule**\n\nThe court applied the principles established in previous cases, including Z.I. Pompey Industrie v. ECU-Line N.V. and Merck and Co. v. Apotex Inc. The court held that the applicant bears the burden of convincing the court on a balance of probabilities that bifurcation or severance is more likely than not to result in the just, expeditious, and least expensive determination of the proceeding on its merits.\n\n**(4) Analysis**\n\nThe court analyzed the decision of Prothonotary Tabib and found that she had considered multiple factors before granting the motion to bifurcate. The court noted that Prothonotary Tabib had considered the evidence before her, the pleadings, her knowledge of the history of the proceeding, and the issues it involved. The court also found that Prothonotary Tabib had not implicitly applied or assumed the existence of a presumption in favor of bifurcation in patent infringement cases. The court concluded that Prothonotary Tabib had not made an error of law in granting the motion to bifurcate.\n\n**(5) Conclusion**\n\nThe court dismissed Novopharm Limited's appeal, finding that Prothonotary Tabib had not erred in granting the motion to bifurcate the issues of quantum from those of validity and infringement of the patent in suit. The court held that Prothonotary Tabib had considered the necessary factors and had not made an error of law in granting the motion. The court also noted that even if it had exercised its discretion de novo, it would have reached the same conclusion as Prothonotary Tabib.",
"cluster: FACTS: The case before the court involves a patent dispute between Eli Lilly Canada Inc. and Novopharm Limited. Eli Lilly Canada Inc. had sought a motion to bifurcate the issues of quantum from those of validity and infringement of the patent in suit. Prothonotary Tabib granted the motion, and Novopharm Limited appealed the decision. The parties involved in the case had been litigating for some time, and the court was considering the appropriateness of bifurcation to speed up the determination of the liability issues and to avoid quantification exercises."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]This is a sentence-transformers model finetuned from nomic-ai/nomic-embed-text-v1.5. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
SentenceTransformer(
(0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: NomicBertModel
(1): Pooling({'word_embedding_dimension': 768, '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})
)
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("simonosgoode/nomic_embed_fine_tune_law_v3")
# Run inference
sentences = [
'cluster: ISSUES: Abdou v. Canada (Citizenship and Immigration)\nCourt (s) Database\nFederal Court Decisions\nDate\n2014-05-26\nNeutral citation\n2014 FC 500\nFile numbers\nT-1638-13\nDecision Content\nDate: 20140526\nDocket:\nT-1638-13\nCitation: 2014 FC 500\nOttawa, Ontario, May 26, 2014\nPRESENT: The Honourable Mr. Justice Manson\nBETWEEN:\nHATEM SALAMA RE ABDOU\nApplicant\nand\nTHE MINISTER OF CITIZENSHIP AND IMMIGRATION\nRespondent\nREASONS FOR JUDGMENT AND JUDGMENT\n[1] This is an appeal of the decision of Wojciech Sniegowski, a Citizenship Judge with the Citizenship Commission, Immigration Canada [the Judge], pursuant to subsection 14(5) of the Citizenship Act, RSC 1985, c C-29 [the Act]. The Judge denied the Applicant’s application for Canadian citizenship by deciding that he did not meet the residency requirement as defined in 5(1)(c) of the Act. .\nI. Issues [2] The issues are:\nA. Was the Judge’s decision reasonable in finding that the Applicant did not meet the residency requirement in 5(1)(c) of the Act?\nB. Did the Judge breach the duty of procedural fairness?\nII. Standard of Review [3] The issues involving the assessment of evidence and of mixed fact and law are reviewable on the standard of reasonableness (Dunsmuir v New Brunswick, 2008 SCC 9, at para 47-48 51, 53-54, 57, 62, 64; Singh v Canada (Minister of Citizenship and Immigration), 2008 FC 408 at para 10).\n[4] The issue of procedural fairness is reviewable on the standard of correctness (Dunsmuir, at paras 57, 79; Navidi v Canada (Minister of Citizenship and Immigration), 2012 FC 372, at para 13 [Navidi]).\nIII. Background [5] The Applicant is a stateless individual who was born in Kuwait. He arrived in Canada on June 7, 2003, and became a Permanent Resident of Canada on that date. He made an application for Canadian citizenship on August 8, 2008. For purposes of the residency requirement in 5(1)(c) of the Act, the Relevant Period at issue is August 8, 2004, to August 8, 2008 [the Relevant Period].\n[6] In his original application for citizenship, the Applicant listed three absences from Canada totalling 354 days. This includes a 320 day absence to Kuwait from 2004-2005. However, in his follow-up Residency Questionnaire, the Applicant listed only 34 days of absence, omitting the 320 day absence to Kuwait listed in his original application.\n[7] In support of his application, the Applicant submitted numerous documents, including:\n• Records with the Ontario Ministry of Health;\n• Notices of Assessment for 2003-2006, 2008;\n• Gas receipts;\n• Report cards for his children in Ontario schools;\n• Incorporation documents for 6612237 Canada Limited, a corporation for which the Applicant is an Officer and Director;\n• Banking records showing numerous wire transfers beginning in March, 2006;\n• Documentation pertaining to the removal of conditions that were imposed on him as a Permanent Resident;\n• Copies of two passports belonging to the Applicant. One is valid from September 15, 2002, to October 2, 2004, and contains a Kuwaiti residence permit valid from September 24, 2001, to September 9, 2004. The other is valid from May 5, 2009, to May 4, 2014, and contains a Kuwaiti residence permit valid from May 20, 2009, to July 3, 2010;\n• A Citizen’s Report from the Hamilton Police Service, which notes that his passport was not recovered after a stolen vehicle was returned to the Applicant, on or around October 3, 2007; and\n• Documents regarding financial and real estate dealings.\n[8] The Applicant did not submit a passport which covered the period from September 10, 2004, to May 4, 2009.\n[9] The Applicant had an interview before the Judge on April 18, 2013.\n[10] The Judge evaluated whether the Applicant met the residency requirement in 5(1)(c) of the Act in accordance with the test from (Re) Pourghasemi, [1993] FCJ No 232 (TD) [Pourghasemi]. In so doing, the Judge was not satisfied that the Applicant had proven that he was physically present in Canada for 1,095 days during the relevant period.\n[11] The Judge noted credibility concerns regarding the discrepancy between the absences listed on his original application (354 days) and his residence questionnaire (34 days). Additionally, without a passport submitted that was valid for the bulk of the Relevant Period, his absences were not verifiable.\n[12] The Judge found that the banking records submitted to prove the sale of construction equipment were more consistent with money transfers aimed at supporting family in Canada. This is supported by the fact that on his Residence Questionnaire, the Applicant claimed he sold his construction company in 2004.\n[13] Further, the Judge found that the lack of any reported income in 2003 and 2004 does not support his contention that he lived in Canada during the Relevant Period.\n[14] Based on the information submitted, the Judge was not satisfied that he had met the test from Pourghasemi (Atwani v Canada (Minister of Citizenship and Immigration), 2011 FC 1354, at paras 12, 18).\nIV. Analysis A. Was the Judge’s decision reasonable? [15] The Applicant makes limited submissions on the reasonableness of the Judge’s decision. His arguments amount to a claim that the Judge failed to properly consider the evidence of the Applicant’s Ministry of Health records, gas receipts, and documentation pertaining to the removal of conditions imposed on him as a Permanent Resident.\n[16] While the Judge did not cite all the evidence mentioned by the Respondent, as a whole the Judge’s decision was reasonable. There was a significant discrepancy between the absences declared in the Applicant’s original application and his Residence Questionnaire. The lack of a passport to verify these absences leaves the Applicant without clear or convincing evidence of his physical presence in Canada during the Relevant Period. In addition, it was reasonable of the Judge to find that the money transfers were more consistent with supporting family in Canada than of the gradual selling of construction equipment, given that the Applicant claimed he sold his construction equipment in 2004.\n[17] The Applicant’s arguments amount to assertions that the Judge failed to appropriately consider the evidence. This is not sufficient to show that the Judge’s decision was unreasonable.\nB. Did the Judge breach the duty of procedural fairness? [18] The Applicant notes that section 1.10 of the Citizenship Policy Manual [the Manual] suggests that a high degree of procedural fairness may be required of a citizenship judge due to the nature of the rights at issue. At sections 1.12 and 1.19 of the Manual, the content of this duty is described as including the right to be heard and that it may be unfair for a citizenship judge to base a decision on information that the applicant has not had an opportunity to comment on.\n[19] The Applicant argues that he was never given an opportunity to address a number of the Judge’s concerns. First, the Judge did not question him about the discrepancy in the absences declared in his citizenship application and his Residence Questionnaire. Second, the Judge did not give the Applicant an opportunity to explain why he was unable to submit a passport to corroborate his stated absences. Third, the Judge drew a negative inference from the Applicant’s history of money transfers, without giving the Applicant an opportunity to explain how these transfers reflect Kuwaiti business practices.\n[20] As these findings were central to the Judge’s decision, the Applicant argues that he ought to have been given an opportunity to respond to them.\n[21] At paras 8 and 10-12 of his affidavit, the Applicant describes a number of issues that were not raised by the Judge in his interview:\n8. At the outset of the interview, the citizenship judge flatly told me he did not want to see any documents that I had in my possession. The citizenship judge was mainly focussed on questioning me about the money I brought to Canada by means of selling heavy construction equipment in Kuwait…\n10…I was never questioned by the citizenship judge at my interview concerning the discrepancy which I was in a position to explain and satisfy the citizenship judge as to why and how the discrepancy came about.\n11…the citizenship judge did not provide me with an opportunity to address his concerns concerning the missing passport and if he had allowed me the opportunity to address his concerns, I would have been able to provide evidence concerning my trips during the years 2004 and 2009 outside Canada.\n12…I was not questioned by the citizenship judge concerning any medical problems that my family members had during the time I was in Canada and if he had done so, I would have been in a position to show the citizenship judge that I had to be in Canada for approximately one year when my daughter, Tala lost an eye due to an accident which occurred in or about October 2006.\n[22] This summary is supported by the notes of the interview provided by the Judge at pages 30-32 of the Certified Tribunal Record. These notes primarily relate to the money the Applicant brought into Canada, the alleged sale of heavy construction equipment by the Applicant, and some background information.\n[23] A fair reading of the Applicant’s affidavit and the Judge’s notes shows that the Judge did not focus his questioning on the discrepancy in the absences declared, the lost passport, or the other documentary evidence submitted.\n[24] The content of the procedural fairness required of a Judge in the context of a citizenship interview was described in Johar v Canada (Minister of Citizenship and Immigration), 2009 FC 1015, at para 41 [Johar]:\nThe Citizenship Judge is not obligated to provide an appellant with an opportunity to file additional material. The process cannot become a running commentary on the adequacy of the appellant\'s evidence (Zheng v. Canada (MCI), 2007 FC 1311, 163 A.C.W.S. (3d) 120, per Justice Simpson at para. 14). However, it is well established that an interview with the Citizenship Judge is "clearly intended to provide the candidate the opportunity to answer or, at the very least, address the concerns which gave rise to the request for an interview in the first place", and when an appellant is deprived of the opportunity to address those concerns, a denial of natural justice occurs (Stine v. Canada (MCI), [1999] F.C.J. No. 1264 (QL), 173 F.T.R. 298, per Justice Pelletier at para. 8; Tshimanga v. Canada (MCI), 2005 FC 1579, 151 A.C.W.S. (3d) 18, per Deputy Justice Rouleau at para. 17-19).\nAt issue in Johar was a lost passport and credibility concerns relating to that loss, similar to this case.\n[25] The Respondent cites Navidi in support of its position. In Navidi, the applicant’s travel history included a number of undeclared absences. The judge held that this undermined the applicant’s credibility and none of the other evidence submitted by the applicant was sufficient to show that 5(1)(c) of the Act was satisfied. The applicant claimed that he had not been afforded due procedural fairness as he was not given an opportunity to respond to the negative credibility finding in his interview. However, in Navidi, the judge did request additional submissions of the applicant (Navidi, at para 31).\n[26] The Judge’s decision in this appeal hinged on a negative credibility finding, based on the discrepancy in the absences declared by the Applicant. As in Johar, the Judge did not raise this discrepancy with the Applicant. Given the necessary procedural fairness afforded to applicants in citizenship applications and the centrality of this issue to the Applicant’s claim, I find that there was a breach of procedural fairness.\nJUDGMENT\nTHIS COURT’S JUDGMENT is that:\n1. The Applicant’s appeal is allowed and his application is referred back to another Citizenship Judge for re-determination.\n"Michael D. Manson"\nJudge\nFEDERAL COURT\nSOLICITORS OF RECORD\nDOCKET:\nT-1638-13\nSTYLE OF CAUSE:\nHATEM SALAMA RE ABDOU v THE MINISTER OF CITIZENSHIP AND IMMIGRATION\nPLACE OF HEARING:\nToronto, ontario\nDATE OF HEARING:\nMay 21, 2014\nREASONS FOR JUDGMENT AND JUDGMENT:\nMANSON J.\nDATED:\nMay 26, 2014\nAPPEARANCES:\nDonald Greenbaum\nFor The Applicant,\nHATEM SALAMA RE ABDOU\nSuzanne M. Bruce\nFor The Respondent,\nTHE MINISTER OF CITIZENSHIP AND IMMIGRATION\nSOLICITORS OF RECORD:\nDonald M. Greenbaum, QC\nBarrister, Solicitor & Notary Public\nToronto, Ontario\nFor The Applicant,\nHATEM SALAMA RE ABDOU\nWilliam F. Pentney\nDeputy Attorney General of Canada\nToronto, Ontario\nFor The Respondent,\nTHE MINISTER OF CITIZENSHIP AND IMMIGRATION\n',
"cluster: ISSUES: The issues before the court were whether the Judge's decision to deny the person concerned's application for Canadian citizenship was reasonable and whether the Judge breached the duty of procedural fairness. Specifically, the court had to determine whether the Judge's decision was based on a reasonable assessment of the evidence and whether the person concerned was given a fair opportunity to address the concerns raised by the Judge during the interview.",
"cluster: CONCLUSION: The court allowed the person concerned's appeal and referred his application back to another Citizenship Judge for re-determination. The court's decision was based on the finding that the Judge's decision was not reasonable and that the Judge breached the duty of procedural fairness. The court's decision highlights the importance of procedural fairness in citizenship applications and the need for Citizenship Judges to provide applicants with a fair opportunity to address concerns raised during the interview.",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
cluster: ISSUES: Woodbine Entertainment Group v. Horsemen's Benevolent and Protective Association |
cluster: ISSUES: The issue before the court is whether the CPMA's decision to issue a license to WEG in the absence of a Pre-License Agreement with the HBPA and OHHA is valid, and whether the Betting Regulations require such an agreement to be in place before a license can be issued. The HBPA and OHHA seek a writ of prohibition, certiorari, and a declaration that the issuance of licenses by the CPMA in the absence of a Pre-License Agreement is a nullity. WEG, on the other hand, seeks a declaration that certain sections of the Betting Regulations are ultra vires of the Parliament of Canada. |
cluster: FACTS: This case revolves around a dispute between Woodbine Entertainment Group (WEG) and the Horsemen's Benevolent and Protective Association of Ontario (HBPA) and the Ontario Harness Horse Association (OHHA) regarding the issuance of a license to WEG to conduct wagering on simulcast horse racing in Ontario. The HBPA and OHHA are associations representing horsemen who are members of the thoroughbred and standardbred racing industries, respectively. WEG operates horse racing tracks and wagering facilities in Ontario. The Canadian Pari-Mutuel Agency (CPMA) is a national regulatory unit that enforces the Pari-Mutuel Betting Supervision Regulations (Betting Regulations).In 2002, the CPMA issued a license to WEG to conduct wagering on simulcast horse racing in 2003, despite the fact that WEG had not entered into a Pre-License Agreement with the HBPA and OHHA, which are typically required by the Betting Regulations. The CPMA accepted 150 Access Agreements signed by individual hors... |
cluster: ANALYSIS: D Souza v. Canada (Citizenship and Immigration) |
cluster: ANALYSIS: The court finds that the decision of the visa officer was not reasonable. The officer overlooked or misapprehended material evidence, including the couple's explanation for the reduction in work hours and the female employer's prospects of future employment. The officer also made several errors regarding the couple's ability to fulfill the terms of the employment offer, including their financial situation and the number of hours they would need to hire a caregiver. The court finds that the officer's findings were speculative and not based on the evidence.The court also finds that the decision is not justified, transparent, and intelligible. The officer's conclusion that the employment offer was not genuine is not supported by the evidence, and the officer failed to consider the couple's explanations and submissions. |
cluster: ISSUES: The main issue before the court is whether the decision of the visa officer to refuse the person concerned's application for a temporary resident visa and work permit was reasonable. The court also considers whether it should enter an indirect substitution or make a cost order in favour of the person concerned. |
cluster: FACTS: Bellosillo v. Canada |
cluster: FACTS: The person concerned is an inmate in Warkworth Institution, a penitentiary managed by Correctional Service of Canada (CSC). He is serving an indeterminate sentence as a dangerous offender for various sexual assault charges. The person concerned has been ordered to attend Provincial Court in Ottawa on March 30, 2006, to answer to new charges. As a result, he is required to be transferred from Warkworth Institution to the Assessment Unit of Millhaven Institution, and then to the Ottawa Detention Centre. The person concerned has filed a motion for an interim injunction to prevent his transfer to the provincial facilities, citing concerns about his health and potential breaches of his rights under the Canadian Charter of Rights and Freedoms.The CSC has established a community standard for healthcare for inmates, which includes preparing a Health Status Summary for each inmate being transferred between federal and provincial facilities. In this case, the person concerned's ... |
cluster: RULES: The court rules that the person concerned's motion for an interim injunction must fail, as the conditions for granting an interlocutory injunction have not been met. Specifically, the court finds that there is no serious issue to be tried, as the person concerned's health condition is currently under control, and he is considered fit to travel to the provincial detention facility. Additionally, the court finds that the person concerned has not established that he will suffer irreparable harm if his transfer takes place as scheduled. |
MultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
anchor, positive, and negative| anchor | positive | negative | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor | positive | negative |
|---|---|---|
cluster: FACTS: Murphy v. Canada (Attorney General) |
cluster: FACTS: The person concerned, a 58-year-old woman from Gander, Newfoundland, applied for Canada Pension Plan (CPP) disability benefits. She had a significant speech impairment and was unable to work due to a stroke she suffered in 2011 and a knee injury she sustained in 2009. She had a limited education and work experience, with only a few short-term jobs between 1979 and 2011. Her application was initially denied in 2011 and again in 2012 after reconsideration. She appealed the decision to the Social Security Tribunal – General Division (SST-GD), which conducted a paper appeal and denied her application in 2015. The SST-GD found that she failed to prove that she had a severe and prolonged disability on or before December 31, 1997, the minimum qualifying period (MQP) for CPP disability benefits. The person concerned then sought leave to appeal to the Social Security Tribunal – Appeal Division (SST-AD), which denied her application in 2015. She subsequently applied for judicial... |
cluster: CONCLUSION: In conclusion, the court's decision in this case was based on the principle that the SST must interpret and apply the CPP Act in a liberal and generous manner. The court found that the SST-GD and SST-AD had failed to apply this principle in the person concerned's case, and that their decisions were therefore unreasonable. The court's decision was also based on the principle that the person concerned had a right to a more comprehensive disability review that considers her employability in the real world. The court's conclusion was that the SST-AD's decision was not reasonable and that the matter should be remitted to a differently constituted SST-AD for redetermination. |
cluster: CONCLUSION: Altamirano v. Canada (Citizenship and Immigration) |
cluster: CONCLUSION: The court concluded that the RAD's decision is reasonable in light of the Applicants' circumstances and evidence. The application for judicial review is therefore dismissed. |
cluster: SUMMARY: (1) Facts |
cluster: CONCLUSION: Osipova v. Canada (Citizenship and Immigration) |
cluster: CONCLUSION: The court allowed the application for judicial review, set aside the decision, and remitted the matter back to a different officer for redetermination. Prior to the redetermination, the person concerned would be given an opportunity to provide updated submissions and documentation in support of her application. The court found that the Officer's BIOC analysis was unreasonable, which rendered the decision as a whole unreasonable, and that the person concerned had raised sufficient grounds for judicial review. |
cluster: ISSUES: The sole issue before the court was whether the Officer's decision was reasonable. The person concerned argued that the Officer's decision was unreasonable due to several factors, including a failure to conduct a proper assessment of hardship, an error in assessing the best interests of the child, and a failure to give proper consideration to adverse country conditions in Russia. |
MultipleNegativesRankingLoss with these parameters:{
"scale": 20.0,
"similarity_fct": "cos_sim"
}
eval_strategy: stepsper_device_train_batch_size: 4per_device_eval_batch_size: 4learning_rate: 2e-05num_train_epochs: 1warmup_ratio: 0.1fp16: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 4per_device_eval_batch_size: 4per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Truefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Falsehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters: auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportional| Epoch | Step | Training Loss | Validation Loss |
|---|---|---|---|
| 0.0314 | 100 | 0.7181 | 0.0840 |
| 0.0627 | 200 | 0.0542 | 0.0354 |
| 0.0941 | 300 | 0.0323 | 0.0264 |
| 0.1255 | 400 | 0.0238 | 0.0305 |
| 0.1568 | 500 | 0.0307 | 0.0166 |
| 0.1882 | 600 | 0.0266 | 0.0173 |
| 0.2196 | 700 | 0.0101 | 0.0130 |
| 0.2509 | 800 | 0.0159 | 0.0111 |
| 0.2823 | 900 | 0.0134 | 0.0113 |
| 0.3137 | 1000 | 0.0125 | 0.0133 |
| 0.3450 | 1100 | 0.0204 | 0.0111 |
| 0.3764 | 1200 | 0.017 | 0.0083 |
| 0.4078 | 1300 | 0.0172 | 0.0066 |
| 0.4391 | 1400 | 0.0133 | 0.0047 |
| 0.4705 | 1500 | 0.0141 | 0.0047 |
| 0.5019 | 1600 | 0.0089 | 0.0053 |
| 0.5332 | 1700 | 0.0068 | 0.0067 |
| 0.5646 | 1800 | 0.0145 | 0.0053 |
| 0.5960 | 1900 | 0.0096 | 0.0058 |
| 0.6274 | 2000 | 0.0024 | 0.0056 |
| 0.6587 | 2100 | 0.0084 | 0.0044 |
| 0.6901 | 2200 | 0.0028 | 0.0035 |
| 0.7215 | 2300 | 0.002 | 0.0034 |
| 0.7528 | 2400 | 0.0045 | 0.0040 |
| 0.7842 | 2500 | 0.0033 | 0.0044 |
| 0.8156 | 2600 | 0.0013 | 0.0037 |
| 0.8469 | 2700 | 0.0047 | 0.0034 |
| 0.8783 | 2800 | 0.0018 | 0.0030 |
| 0.9097 | 2900 | 0.0021 | 0.0030 |
| 0.9410 | 3000 | 0.0041 | 0.0028 |
| 0.9724 | 3100 | 0.0063 | 0.0026 |
@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",
}
@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}
}
Base model
nomic-ai/nomic-embed-text-v1.5