1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("sentence_transformers_model_id")
5# Run inference
6sentences = [
7 "8. The applicant was born in 1947 and lives in Karlovac, Croatia. 9. On 6 February 1999 the applicant was driving from Bosnia and Herzegovina and crossed the border to Croatia at the checkpoint at Maljevac. He was stopped by a customs officer for a routine check. 10. The applicant gives the following account of what happened at the border checkpoint. Before arriving in Croatia, the applicant and another person, K.B., had purchased four cartons of cigarettes and two litres of cooking oil. 11. At the border checkpoint they were approached by a customs officer who asked the applicant if he had anything to declare. The applicant pointed at the purchased goods, lying in the backseat of the car, inviting the customs officer to take a look. The officer then asked the applicant to show him his passport. While holding the applicant's passport the officer told the applicant that he had failed to declare the goods and thus committed a customs offence. He asked the applicant to pay a fine in the amount of two hundred Croatian Kunas (hereinafter HRK). 12. The applicant told the officer that he could not pay the fine right away because he did not have enough money on him. The officer did not return the applicant's passport and told him that he would receive his passport when he had paid the fine. The applicant then continued to Croatia. 13. The Government gave the following account of the facts. While entering Croatia the applicant failed to declare goods that he had purchased in Bosnia and Herzegovina. However, a customs officer found five cartons of cigarettes and two litres of cooking oil in the applicant's car. He routinely fined the applicant with HRK 200 [Approximately 30 euros] for a minor customs offence. The applicant was immediately given a document which stated that he was fined with HRK 200 for having failed to declare five cartons of cigarettes he was importing. The applicant signed the document. During this procedure the applicant's passport was kept by the customs officer, who had intended to return it to the applicant. However, the applicant refused to pay the fine and demonstratively drove away, leaving his passport behind. 14. On 10 February 1999 the applicant wrote from his address in Karlovac to the Ministry of Finance, Customs Administration Headquarters asking that his passport be returned. 15. On 22 February 1999 the Customs Administration replied to the applicant's address in Karlovac that the custom officers acted in accordance with law when they seized the applicant's passport because he had refused to pay the fine for a customs offence which he had committed by failing to declare goods at a border checkpoint. They relied on Sections 325 to 333 of the Customs Act which, inter alia, provided that a person, while crossing a customs check point, had to declare and show all goods that he was importing. Failure to declare such goods represented a customs offence. The letter also stated that since the applicant had not declared the goods that he had been importing to Croatia, he had committed a customs offence under Section 353 of the Customs Act and fined pursuant to § 2 of that Section. The applicant's passport had been kept because the applicant had refused to pay the fine. The letter contained no indication of how and when the applicant's passport would be returned. 16. Although the applicant did not pay the imposed fine no other proceedings were instituted against him for the alleged customs offence. 17. In the meantime, on 12 February 1999, the Customs Administration, apparently having decided not to institute any further proceedings against the applicant, handed over the passport to the Slunj Customs Police Department. The Police noticed, however, that the applicant was registered as living in Zagreb for which reason, on 4 March 1999, the passport was sent to the Zagreb Police Department. 18. On 5 March 1999 the Zagreb Police Department wrote to the applicant's registered address in Zagreb inviting him to collect his passport. The letter was returned. On 6 April 1999 the Zagreb Police Department wrote once more to the applicant, but the letter was again returned. The receipt showed that the applicant was unknown at that address. 19. The Police discovered subsequently that the applicant, although registered as living in Zagreb, actually lived in Karlovac. On 23 March 2001 the passport was sent to the Karlovac Police Department which invited the applicant to collect his passport. He did so on 4 April 2001. 20. Having received the Customs Administration's letter of 22 February 1999 the applicant filed a civil suit on 2 March 1999 in the Zagreb Municipal Court against the Ministry of Finance, seeking the return of his passport and damages flowing from his inability to leave Croatia. He also requested the court to adopt an interim measure and order that his passport be returned to him immediately. 21. On 13 April 1999 the applicant also filed an application in the Zagreb County Court claiming that the seizure of his passport by a customs officer was an unlawful act and that therefore, his right to freedom of movement had been violated. He requested the court to order the Ministry of Finance to return his passport forthwith. 22. On 21 September 1999 the Zagreb County Court dismissed the applicant's claim. It found that a claim for protection from an unlawful act was permitted only if there was no other remedy available. In the opinion of the court the applicant had at his disposal another remedy - a civil action for the return of his property. Accordingly, it instructed the applicant to institute civil proceedings in a municipal court against the Ministry of Finance for the return of his passport. 23. The applicant appealed against the decision. 24. The applicant's appeal was rejected on 20 April 2000 by the Supreme Court (Vrhovni sud Republike Hrvatske). 25. In the meantime, at a hearing on 12 April 1999 the Zagreb Municipal Court, in the proceedings instituted on 2 March 1999, against the Ministry of Finance, separated the applicant's claim for damages from the claim for return of the passport. 26. Concerning the claim for return of the applicant's passport the next hearing was held on 11 February 2000. At that hearing the court heard the applicant and then decided to hear K.B., who was with the applicant in the car at the material time. It was furthermore agreed between the parties to adjourn the issue of damages pending the outcome of the claim for the return of the passport. 27. At a hearing on 1 December 2000 the court heard the customs officer who took the applicant's passport. It also invited the applicant to submit within thirty days a copy of the letter that he had sent to the Customs Administration as well as their reply. 28. On 23 January 2001 the applicant submitted the Customs Administration's reply of 22 February 1999. 29. At a hearing on 21 February 2001 the court heard another customs officer and once again the applicant. It then rejected the applicant's request for an interim measure finding that the applicant's main claim, i.e. to have his passport returned, was exactly the same as his request for the interim measure and that, therefore, such a request could only be decided after the court established all the relevant facts of the case. 30. On 23 February 2001 the applicant filed an application asking that the judge be removed from the case. On 7 March 2001 the President of the Zagreb Municipal Court rejected the applicant's motion. 31. The next hearing was held on 13 April 2001. The applicant informed the court that on 4 April 2001 the Karlovac Police Department had returned his passport. Therefore, he no longer sought the return of his passport but instead sought a declaratory decision to the effect that on 6 February 1999 his passport was taken from him by the Croatian authorities and returned on 4 April 2001. He also sought costs. 32. On 24 April 2001 the applicant filed submissions with the court repeating the statements and claims he made at the hearing on 13 April 2001. 33. On 16 May 2001 the applicant's counsel appeared before the judge and agreed to reformulate the applicant's claim having regard to the fact that the passport had already been returned to him. 34. The next hearing was held on 28 May 2001 during which it was formally recorded that the passport had been returned to the applicant. The applicant's counsel sought from the court permission to specify the applicant's remaining claims. The court allowed her to do so within thirty days. 35. On 7 June 2001 the applicant himself filed submissions to the court reiterating the same claims as those submitted on 24 April 2001. No additional claims were submitted by the applicant's counsel. 36. On 13 August 2001 the applicant again filed an application asking that the judge be removed from the case. The President of the court accepted the request and the case was transferred to another judge. 37. Following a hearing on 14 November 2001 the court dismissed the applicant's claims. It found that the applicant had no further legal interest in seeking a declaratory decision that his passport had been taken from him by the Croatian authorities on 6 February 1999 and then returned on 4 April 2001. The applicant was also ordered to pay the defendant's costs. 38. The applicant's subsequent appeal was dismissed and the first instance decision was upheld by the Zagreb County Court (Županijski sud u Zagrebu) on 10 September 2002. It held that the applicant had no legal interest in seeking a declaratory decision and that the Zagreb Municipal Court's decision on the costs of the proceedings was well-founded because the applicant had lost his case. 39. According to the applicant the proceedings concerning his claim for damages have never been resumed and on 24 January 2002 the case was closed without any decision on the merits been taken. 40. According to the Government the case has not been closed and the proceedings are still pending.",
8 'Right to a fair trial 1. In the determination of his civil rights and obligations or of any criminal charge against him, everyone is entitled to a fair and public hearing within a reasonable time by an independent and impartial tribunal established by law. Judgment shall be pronounced publicly but the press and public may be excluded from all or part of the trial in the interests of morals, public order or national security in a democratic society, where the interests of juveniles or the protection of the private life of the parties so require, or to the extent strictly necessary in the opinion of the court in special circumstances where publicity would prejudice the interests of justice. 2. Everyone charged with a criminal offence shall be presumed innocent until proved guilty according to law. 9 3. Everyone charged with a criminal offence has the following minimum rights: (a) to be informed promptly, in a language which he understands and in detail, of the nature and cause of the accusation against him; (b) to have adequate time and facilities for the preparation of his defence; (c) to defend himself in person or through legal assistance of his own choosing or, if he has not sufficient means to pay for legal assistance, to be given it free when the interests of justice so require; (d) to examine or have examined witnesses against him and to obtain the attendance and examination of witnesses on his behalf under the same conditions as witnesses against him; (e) to have the free assistance of an interpreter if he cannot understand or speak the language used in court.',
9 'COMMISSION DECISION of 17 December 1996 concerning protective measures with regard to imports of certain animals and their products from Bulgaria due to an outbreak of foot-and-mouth disease and repealing Decision 96/643/EC (Text with EEA relevance) (96/730/EC)\nTHE COMMISSION OF THE EUROPEAN COMMUNITIES\n,\nHaving regard to the Treaty establishing the European Community,\nHaving regard to Council Directive 90/675/EEC of 10 December 1990 laying down the principles governing the organization of veterinary checks on products entering the Community from third countries (1), as last amended by Directive 96/43/EC (2), and in particular Article 19 (6) thereof,\nHaving regard to Council Directive 91/496/EEC of 15 July 1991 laying down the principles governing the organization of veterinary checks on animals entering the Community from third countries and amending Directives 89/662/EEC, 90/425/EEC and 90/675/EEC (3), as last amended by Directive 96/43/EC, and in particular Article 18 (1),\nWhereas one outbreak of foot-and-mouth disease occurred on 25 October 1996 in Bulgaria;\nWhereas the Bulgarian authorities took action to prohibit the spread of the disease;\nWhereas to protect the livestock population of the Community, the Commission adopted Decision 96/643/EC of 13 November 1996, concerning protective measures with regard to imports of certain animals and their products from Bulgaria (4);\nWhereas Commission Decision 93/242/EEC of 30 April 1993, concerning the importation into the Community of certain live animals and their products originating from certain European countries in relation to foot-and-mouth disease (5), as last amended by Decision 96/643/EC, allows under certain conditions, the importation of live animals, fresh meat and certain meat products from and through certain countries;\nWhereas Commission Decision 95/340/EC (6), as last amended by Decision 96/325/EC (7), draws up a list of third countries from which Member States authorize imports of raw milk, heat-treated milk and milk-based products; whereas Bulgaria is included in this list; whereas it is necessary to ensure that any imported milk products have undergone a treatment sufficient to destroy the virus;\nWhereas Council Directive 92/118/EEC of 17 December 1992 lays down animal health and public health requirements governing trade in and imports into the Community of products not subject to the said requirements laid down in specific Community rules referred to at Annex A (I) to Directive 89/662/EEC and, as regards pathogens, Directive 90/425/EEC (8), as last amended by Commission Decision 96/340/EC (9), lays down the conditions for the importation of animals casings, hides and skins, bones and bone products, horn and horn products, hooves and hoof products, game trophies and unprocessed wool and hair; whereas these products may be imported only if treated in such a way as to destroy the virus; whereas, however, certain other products may still be imported; whereas this material constitutes a risk;\nWhereas following a Community mission to Bulgaria it has been established that disease control measures have been effectively implemented and prevent the spread of the disease;\nWhereas it is possible to apply the principle of regionalization;\nWhereas with the aim of clarity, Decision 96/643/EC can be repealed;\nWhereas the measures provided for in this Decision are in accordance with the opinion of the Standing Veterinary Committee,',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 768]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[ 1.0000, 0.4790, 0.1488],
19# [ 0.4790, 1.0000, -0.0600],
20# [ 0.1488, -0.0600, 1.0000]])