Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'RobertaModel'})
(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})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("buelfhood/SOCO-Java-CodeBERTa-MNRL-Triplets-BATL-EVAL-BCE-Ep2")
5# Run inference
6sentences = [
7 'import java.net.*;\nimport java.io.*;\n\npublic class BruteForce {\n private String strUserName;\n private String strURL;\n private int iAttempts;\n \n public BruteForce(String strURL,String strUserName) {\n this.strURL = strURL;\n this.strUserName = strUserName;\n this.iAttempts = 0 ;\n\n }\n \n public String getPassword(){\n URL u;\n String result ="";\n PassGenBrute PG = new PassGenBrute(3);\n URLConnection uc;\n String strPassword = new String();\n String strEncode;\n try{\n while (result.compareTo("HTTP/1.1 200 OK")!=0){\n \n strEncode = PG.getNewPassword();\n u = new URL(strURL);\n uc = u.openConnection();\n uc.setDoInput(true);\n uc.setDoOutput(true);\n strPassword = strEncode;\n strEncode = strUserName + ":" + strEncode;\n \n strEncode = new String(Base64.encode(strEncode.getBytes()));\n uc.setRequestProperty("Authorization"," " + strEncode);\n \n result = uc.getHeaderField(0);\n uc = null;\n u = null;\n iAttempts++;\n }\n\n }\n catch (Exception me) {\n System.out.println("MalformedURLException: "+me);\n }\n return(strPassword);\n }\n \n public int getAttempts(){\n return (iAttempts);\n };\n \n public static void main (String arg[]){\n timeStart = 0;\n timeEnd = 0;\n \n if (arg.length == 2) {\n BruteForce BF = new BruteForce(arg[0],arg[1]);\n System.out.println("Processing ... ");\n timeStart = System.currentTimeMillis();\n \n System.out.println("Password = " + BF.getPassword());\n timeEnd = System.currentTimeMillis();\n System.out.println("Total Time Taken = " + (timeEnd - timeStart) + " (msec)");\n System.out.println("Total Attempts = " + BF.getAttempts());\n }\n else {\n System.out.println("[Usage] java BruteForce <URL> <USERNAME>");\n\n }\n\n }\n}\n\nclass PassGenBrute {\n private char[] password;\n public PassGenBrute(int lenght) {\n password = new char[lenght];\n for (int i = 0; i < lenght; i++){\n password[i] = 65;\n }\n password[0]--;\n }\n \n public String getNewPassword()\n throws PasswordFailureException{\n password[0]++;\n\n try {\n for (int i=0; i<password.length ; i++){\n if (password[i] == 90) {\n password[i] = 97;\n }\n if (password[i] > 122) {\n password[i] = 65;\n password[i+1]++;\n }\n }\n }\n catch (RuntimeException re){\n throw new PasswordFailureException ();\n }\n return new String(password);\n }\n}\n\nclass PasswordFailureException extends RuntimeException {\n\n public PasswordFailureException() {\n }\n}',
8 'import java.net.*;\nimport java.io.*;\n\n\npublic class Dictionary {\n private String strUserName;\n private String strURL;\n private String strDictPath;\n private int iAttempts;\n\n \n public Dictionary(String strURL,String strUserName,String strDictPath) {\n this.strURL = strURL;\n this.strUserName = strUserName;\n this.iAttempts = 0 ;\n this.strDictPath = strDictPath;\n }\n \n\n public String getPassword(){\n URL u;\n String result ="";\n PassGenDict PG = new PassGenDict(3,strDictPath);\n URLConnection uc;\n String strPassword = new String();\n String strEncode;\n try{\n while (result.compareTo("HTTP/1.1 200 OK")!=0){\n \n strEncode = PG.getNewPassword();\n u = new URL(strURL);\n uc = u.openConnection();\n uc.setDoInput(true);\n uc.setDoOutput(true);\n strPassword = strEncode;\n strEncode = strUserName + ":" + strEncode;\n \n strEncode = new String(Base64.encode(strEncode.getBytes()));\n uc.setRequestProperty("Authorization"," " + strEncode);\n \n result = uc.getHeaderField(0);\n uc = null;\n u = null;\n iAttempts++;\n }\n\n }\n catch (Exception me) {\n System.out.println("MalformedURLException: "+me);\n }\n return(strPassword);\n }\n \n public int getAttempts(){\n return (iAttempts);\n };\n \n public static void main(String arg[]){\n timeStart = 0;\n timeEnd = 0;\n \n if (arg.length == 3) {\n Dictionary BF = new Dictionary(arg[0],arg[1],arg[2]);\n\n System.out.println("Processing ... ");\n timeStart = System.currentTimeMillis();\n System.out.println("Password = " + BF.getPassword());\n timeEnd = System.currentTimeMillis();\n System.out.println("Total Time Taken = " + (timeEnd - timeStart) + " (msec)");\n System.out.println("Total Attempts = " + BF.getAttempts());\n }\n else {\n System.out.println("[Usage] java BruteForce <URL> <USERNAME> <Dictionary path>");\n\n }\n\n }\n}\n\n\nclass PassGenDict {\n\n private char[] password;\n private String line;\n int iPassLenght;\n private BufferedReader inputFile;\n public PassGenDict(int lenght, String strDictPath) {\n try{\n inputFile = new BufferedReader(new FileReader(strDictPath));\n }\n catch (Exception e){\n }\n iPassLenght = lenght;\n }\n \n public String getNewPassword()\n throws PasswordFailureException{\n try {\n {\n line = inputFile.readLine();\n }while (line.length() != iPassLenght);\n\n }\n catch (Exception e){\n throw new PasswordFailureException ();\n }\n return (line);\n }\n}\n\nclass PasswordFailureException extends RuntimeException {\n\n public PasswordFailureException() {\n }\n}',
9 'import java.util.*;\nimport java.io.*;\nimport javax.swing.text.html.*;\n\n\npublic class WatchDog {\n\n public WatchDog() {\n\n }\n public static void main (String args[]) {\n DataInputStream newin;\n\n try{\n System.out.println("ishti");\n\n System.out.println("Downloading first copy");\n Runtime.getRuntime().exec("wget http://www.cs.rmit.edu./students/ -O oldfile.html");\n String[] cmdDiff = {"//sh", "-c", "diff oldfile.html newfile.html > Diff.txt"};\n String[] cmdMail = {"//sh", "-c", "mailx -s \\"Diffrence\\" \\"@cs.rmit.edu.\\" < Diff.txt"};\n while(true){\n Thread.sleep(24*60*60*1000);\n System.out.println("Downloading new copy");\n Runtime.getRuntime().exec("wget http://www.cs.rmit.edu./students/ -O newfile.html");\n Thread.sleep(2000);\n Runtime.getRuntime().exec(cmdDiff);\n Thread.sleep(2000);\n newin = new DataInputStream( new FileInputStream( "Diff.txt"));\n if (newin.readLine() != null){\n System.out.println("Sending Mail");\n Runtime.getRuntime().exec(cmdMail);\n Runtime.getRuntime().exec("cp newfile.html oldfile.html");\n\n }\n }\n\n }\n catch(Exception e){\n e.printStackTrace();\n }\n\n }\n\n}',
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.9997, -0.1560],
19# [ 0.9997, 1.0000, -0.1547],
20# [-0.1560, -0.1547, 1.0000]])binary-class-evaluatorBinaryClassificationEvaluator| Metric | Value |
|---|---|
| cosine_accuracy | 0.998 |
| cosine_accuracy_threshold | 0.967 |
| cosine_f1 | 0.75 |
| cosine_f1_threshold | 0.967 |
| cosine_precision | 1.0 |
| cosine_recall | 0.6 |
| cosine_ap | 0.607 |
| cosine_mcc | 0.7738 |
anchor_code, positive_code, and negative_code| anchor_code | positive_code | negative_code | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor_code | positive_code | negative_code |
|---|---|---|
[object Object][object Object]import java.io.[object Object];[object Object]import java.misc.BASE64Encoder;[object Object][object Object]public class Dictionary[object Object]{[object Object] public Dictionary()[object Object] {}[object Object][object Object] public boolean fetchURL(String urlString,String username,String password)[object Object] {[object Object] StringWriter sw= new StringWriter();[object Object] PrintWriter pw = new PrintWriter();[object Object] try{[object Object] URL url=new URL(urlString); [object Object] String userPwd= username+":"+password;[object Object][object Object] [object Object] [object Object] [object Object] [object Object][object Object] BASE64Encoder encoder = new BASE64Encoder();[object Object] String encodedStr = encoder.encode (userPwd.getBytes());[object Object] System.out.println("Original String = " + userPwd);[object Object] System.out.println("Encoded String = " + encodedStr);[object Object][object Object] HttpURLConnection huc=(HttpURLConnection) url.openConnection(); [object Object] huc.setRequestProperty( "Authorization"," "+encodedStr); [object Object] InputStream content = (InputStream)huc.getInputStream();[object Object] BufferedReader in =[object Object] new BufferedReader (new InputStreamReader (content));[object Object] String line;[object Object] while ((line = in.readLine())... | [object Object][object Object]import java.io.[object Object];[object Object]import java.misc.BASE64Encoder;[object Object][object Object]public class BruteForce[object Object]{[object Object] public BruteForce()[object Object] {}[object Object][object Object] public boolean fetchURL(String urlString,String username,String password)[object Object] {[object Object] StringWriter = new StringWriter();[object Object] PrintWriter pw = new PrintWriter();[object Object] try{[object Object] URL url=new URL(urlString); [object Object] String userPwd= username+":"+password;[object Object][object Object] [object Object] [object Object] [object Object] [object Object][object Object] BASE64Encoder encoder = new BASE64Encoder();[object Object] String encodedStr = encoder.encode (userPwd.getBytes());[object Object] System.out.println("Original String = " + userPwd);[object Object] System.out.println("Encoded String = " + encodedStr);[object Object][object Object] HttpURLConnection huc=(HttpURLConnection) url.openConnection(); [object Object] huc.setRequestProperty( "Authorization"," "+encodedStr); [object Object] InputStream content = (InputStream)huc.getInputStream();[object Object] BufferedReader in = [object Object] new BufferedReader (new InputStreamReader (content));[object Object] String line;[object Object] while ((line = in.readLine()) ... | [object Object][object Object]import java.net.[object Object];[object Object]import java.util.*;[object Object][object Object]public class Dictionary{[object Object][object Object] private static URL location;[object Object] private static String user;[object Object] private BufferedReader input;[object Object] private static BufferedReader dictionary;[object Object] private int maxLetters = 3;[object Object][object Object] [object Object][object Object] public Dictionary() {[object Object] [object Object] Authenticator.setDefault(new MyAuthenticator ());[object Object][object Object] startTime = System.currentTimeMillis();[object Object] boolean passwordMatched = false;[object Object] while (!passwordMatched) {[object Object] try {[object Object] input = new BufferedReader(new InputStreamReader(location.openStream()));[object Object] String line = input.readLine();[object Object] while (line != null) {[object Object] System.out.println(line);[object Object] line = input.readLine();[object Object] }[object Object] input.close();[object Object] passwordMatched = true;[object Object] }[object Object] catch (ProtocolException e)[object Object] {[object Object] [object Object] [object Object] }[object Object] catch (ConnectException e) {[object Object] System.out.println("Failed connect");[object Object] }[object Object] catch (IOException e) ... |
[object Object][object Object][object Object]import java.io.InputStream;[object Object]import java.util.Properties;[object Object][object Object]import javax.naming.Context;[object Object]import javax.naming.InitialContext;[object Object]import javax.rmi.PortableRemoteObject;[object Object]import javax.sql.DataSource;[object Object][object Object][object Object][object Object][object Object][object Object]public class WatchdogPropertyHelper {[object Object][object Object] private static Properties testProps;[object Object][object Object][object Object][object Object] public WatchdogPropertyHelper() {[object Object] }[object Object][object Object][object Object] [object Object][object Object] public static String getProperty(String pKey){[object Object] try{[object Object] initProps();[object Object] }[object Object] catch(Exception e){[object Object] System.err.println("Error init'ing the watchddog Props");[object Object] e.printStackTrace();[object Object] }[object Object] return testProps.getProperty(pKey);[object Object] }[object Object][object Object][object Object] private static void initProps() throws Exception{[object Object] if(testProps == null){[object Object] testProps = new Properties();[object Object][object Object] InputStream fis =[object Object] WatchdogPropertyHelper.class.getResourceAsStream("/watchdog.properties");[object Object] testProps.load(fis);[object Object] }[object Object] }[object Object]}[object Object] | [object Object][object Object][object Object][object Object]import java.io.InputStream;[object Object]import java.util.Properties;[object Object][object Object]import javax.naming.Context;[object Object]import javax.naming.InitialContext;[object Object]import javax.rmi.PortableRemoteObject;[object Object]import javax.sql.DataSource;[object Object][object Object][object Object][object Object][object Object]public class BruteForcePropertyHelper {[object Object][object Object] private static Properties bruteForceProps;[object Object][object Object][object Object][object Object] public BruteForcePropertyHelper() {[object Object] }[object Object][object Object][object Object] [object Object][object Object] public static String getProperty(String pKey){[object Object] try{[object Object] initProps();[object Object] }[object Object] catch(Exception e){[object Object] System.err.println("Error init'ing the burteforce Props");[object Object] e.printStackTrace();[object Object] }[object Object] return bruteForceProps.getProperty(pKey);[object Object] }[object Object][object Object][object Object] private static void initProps() throws Exception{[object Object] if(bruteForceProps == null){[object Object] bruteForceProps = new Properties();[object Object][object Object] InputStream fis =[object Object] BruteForcePropertyHelper.class.getResourceAsStream("/bruteforce.properties");[object Object] bruteForceProps.load(fis);[object Object] }[object Object] }[object Object]}[object Object][object Object] | [object Object][object Object][object Object][object Object][object Object][object Object][object Object][object Object]import java.io.[object Object];[object Object]import javax.swing.Timer;[object Object]import java.awt.event.*;[object Object]import javax.swing.JOptionPane;[object Object][object Object]public class WatchDog [object Object]{[object Object] private static Process pro = null;[object Object] private static Runtime run = Runtime.getRuntime();[object Object] [object Object] public static void main(String[] args) [object Object] {[object Object] String cmd = null;[object Object] try[object Object] {[object Object] cmd = new String("wget -O original.txt [object Object]");[object Object][object Object] pro = run.exec(cmd);[object Object] System.out.println(cmd);[object Object] }[object Object] catch (IOException e)[object Object] {[object Object] }[object Object] [object Object] class Watch implements ActionListener[object Object] {[object Object] BufferedReader in = null;[object Object] String str = null;[object Object] Socket socket;[object Object] public void actionPerformed (ActionEvent event)[object Object] {[object Object] [object Object] try[object Object] {[object Object] System.out.println("in Watch!");[object Object] String cmd = new String();[object Object] int ERROR = 1;[object Object] cmd = new String("wget -O new.txt [object Object]");[object Object][object Object][object Object] System.out.println(cmd);[object Object] cmd = new String("diff original.txt new.txt");[object Object] pro = run.exec(cmd);[object Object] System.out.println(cmd);[object Object] in = new Buf... |
[object Object]import java.net.[object Object]; [object Object]public class BruteForce {[object Object]private static String password=" "; [object Object][object Object] [object Object] public static void main(String[] args) {[object Object] String Result=""; [object Object] if (args.length<1)[object Object] {[object Object] System.out.println("Error: Correct Format Filename, username e.g<>"); [object Object] System.exit(1); [object Object] }[object Object] BruteForce bruteForce1 = new BruteForce();[object Object] Result=bruteForce1.Password("[object Object]]); [object Object] System.out.println("The Password of "+args[0]+"is.."+Result); [object Object] [object Object] }[object Object][object Object][object Object][object Object] private String Password(String urlString,String username) [object Object] { [object Object] int cnt=0;[object Object] [object Object] t0 = System.currentTimeMillis(); [object Object] for ( char ch = 'A'; ch <= 'z'; ch++ )[object Object] { [object Object] if (ch>'Z' && ch<'a')[object Object] { [object Object] ch='a'; [object Object] } [object Object] [object Object] for ( char ch1 = 'A'; ch1 <= 'z'; ch1++ )[object Object] { [object Object] [object Object] if (ch1>'Z' && ch1<'a')[object Object] { [object Object] ch1='a'; [object Object] }[object Object][object Object][object Object] for ( char ch2 = 'A'; ch2 <= 'z'; ch2++ )[object Object] { [object Object] if (ch2>'Z' && ch2<'a')[object Object] { [object Object] ... | [object Object][object Object]import java.net.[object Object]; [object Object]import java.util.Date; [object Object]public class Dictionary{[object Object]private static String password=" "; [object Object][object Object] [object Object] public static void main(String[] args) {[object Object] String Result=""; [object Object] if (args.length<1)[object Object] {[object Object] System.out.println("Correct Format Filename username e.g<>"); [object Object] System.exit(1); [object Object] }[object Object] [object Object] Dictionary dicton1 = new Dictionary();[object Object] Result=dicton1.Dict("[object Object]]); [object Object] System.out.println("Cracked Password for The User "+args[0]+" The Password is.."+Result); [object Object] [object Object][object Object] [object Object] [object Object] }[object Object][object Object][object Object][object Object] private String Dict(String urlString,String username) [object Object] { [object Object] int cnt=0;[object Object] FileInputStream stream=null;[object Object] DataInputStream word=null;[object Object][object Object] try{ [object Object] stream = new FileInputStream ("/usr/share/lib/dict/words"); [object Object][object Object] word =new DataInputStream(stream);[object Object] t0 = System.currentTimeMillis(); [object Object] while (word.available() !=0) [object Object] {[object Object] [object Object] password=word.readLine();[object Object] if (password.length()!=3)[object Object] {[object Object] continue;[object Object] }[object Object] System.out.print("... | [object Object]package java.httputils;[object Object][object Object]import java.io.IOException;[object Object]import java.net.MalformedURLException;[object Object]import java.util.ArrayList;[object Object]import java.util.Iterator;[object Object][object Object][object Object]public class RunnableHttpRequest extends Thread[object Object]{[object Object] protected String targetURL = "[object Object]";[object Object] protected int requestCount = 1;[object Object] protected ArrayList timingList = new ArrayList();[object Object] protected HttpRequestClient req;[object Object] Boolean finished = new Boolean(false);[object Object] HttpRequestThreadPool pool;[object Object][object Object] [object Object] public void run()[object Object] {[object Object] try[object Object] {[object Object] for (int i = 0; i < getRequestCount() && !getFinished().booleanValue(); i++)[object Object] {[object Object] try[object Object] {[object Object] req =[object Object] new HttpRequestClient(getTargetURL());[object Object][object Object] [object Object] }[object Object] catch (MalformedURLException e)[object Object] {[object Object] e.printStackTrace();[object Object] break;[object Object] }[object Object] catch (IOException e)[object Object] {[object Object] ... |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}anchor_code, positive_code, and negative_code| anchor_code | positive_code | negative_code | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor_code | positive_code | negative_code |
|---|---|---|
[object Object][object Object][object Object][object Object][object Object][object Object]import java.util.[object Object];[object Object][object Object]public class WatchDog[object Object]{ [object Object][object Object] public static void main(String args[])[object Object] {[object Object][object Object] Runtime rt1 = Runtime.getRuntime();[object Object] Process prss1= null;[object Object][object Object] try[object Object] {[object Object] prss1 = rt1.exec("wget -R mpg,mpeg, --output-document=first.html [object Object]");[object Object] }catch(java.io.IOException e){}[object Object][object Object] MyWatchDogTimer w = new MyWatchDogTimer();[object Object] Timer time = new Timer();[object Object] time.schedule(w,864000000,864000000);[object Object][object Object] [object Object] }[object Object]}[object Object] | [object Object][object Object][object Object][object Object][object Object]import java.util.[object Object];[object Object][object Object]public class MyTimer[object Object]{ [object Object][object Object] public static void main(String args[])[object Object] {[object Object] Watchdog watch = new Watchdog();[object Object] Timer time = new Timer();[object Object] time.schedule(watch,864000000,864000000);[object Object] [object Object] [object Object] }[object Object]}[object Object] | import java.net.[object Object]; [object Object]import java.util.Vector;[object Object]import java.util.Date;[object Object]import java.security.[object Object]1000*60;[object Object] boolean timedOut=false;[object Object] boolean found=false;[object Object] [object Object] [object Object] Vector dictionary=new Vector(readWords());[object Object] System.out.println("Words in dictionary: "+dictionary.size());[object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] while (found==false && timedOut==false && dictionary.elementAt(count)!=null) {[object Object] [object Object] Date endDate = new Date();[object Object] endTime=endDate.getTime(); [object Object] if (endTime>(TIMELIMIT+startTime)){[object Object] System.out.println("Timed out");[object Object] timedOut=true;[object Object] }[object Object] [object Object] String password = "";[object Object][object Object] ... |
[object Object][object Object][object Object]import java.io.InputStream;[object Object]import java.util.Properties;[object Object][object Object]import javax.naming.Context;[object Object]import javax.naming.InitialContext;[object Object]import javax.rmi.PortableRemoteObject;[object Object]import javax.sql.DataSource;[object Object][object Object][object Object][object Object][object Object][object Object][object Object]public class MailsendPropertyHelper {[object Object][object Object] private static Properties testProps;[object Object][object Object] public MailsendPropertyHelper() {[object Object] }[object Object][object Object][object Object] [object Object][object Object] public static String getProperty(String pKey){[object Object] try{[object Object] initProps();[object Object] }[object Object] catch(Exception e){[object Object] System.err.println("Error init'ing the watchddog Props");[object Object] e.printStackTrace();[object Object] }[object Object] return testProps.getProperty(pKey);[object Object] }[object Object][object Object][object Object] private static void initProps() throws Exception{[object Object] if(testProps == null){[object Object] testProps = new Properties();[object Object][object Object] InputStream fis =[object Object] MailsendPropertyHelper.class.getResourceAsStream("/mailsend.properties");[object Object] testProps.load(fis);[object Object] }[object Object] }[object Object]}[object Object][object Object][object Object][object Object][object Object][object Object] | [object Object][object Object][object Object][object Object]import java.io.InputStream;[object Object]import java.util.Properties;[object Object][object Object]import javax.naming.Context;[object Object]import javax.naming.InitialContext;[object Object]import javax.rmi.PortableRemoteObject;[object Object]import javax.sql.DataSource;[object Object][object Object][object Object][object Object][object Object]public class BruteForcePropertyHelper {[object Object][object Object] private static Properties bruteForceProps;[object Object][object Object][object Object][object Object] public BruteForcePropertyHelper() {[object Object] }[object Object][object Object][object Object] [object Object][object Object] public static String getProperty(String pKey){[object Object] try{[object Object] initProps();[object Object] }[object Object] catch(Exception e){[object Object] System.err.println("Error init'ing the burteforce Props");[object Object] e.printStackTrace();[object Object] }[object Object] return bruteForceProps.getProperty(pKey);[object Object] }[object Object][object Object][object Object] private static void initProps() throws Exception{[object Object] if(bruteForceProps == null){[object Object] bruteForceProps = new Properties();[object Object][object Object] InputStream fis =[object Object] BruteForcePropertyHelper.class.getResourceAsStream("/bruteforce.properties");[object Object] bruteForceProps.load(fis);[object Object] }[object Object] }[object Object]}[object Object][object Object] | [object Object]import java.net.[object Object];[object Object]import java.Ostermiller.util.[object Object];[object Object][object Object]public class MyClient2 implements Runnable[object Object]{[object Object] private String hostname;[object Object] private int port;[object Object] private String filename;[object Object] private Socket s;[object Object] private int n;[object Object] private InputStream sin;[object Object] private OutputStream sout;[object Object] private int dif;[object Object] private String myPassword;[object Object] private int status;[object Object] private int myTime;[object Object] private BruteForce myMaster;[object Object] [object Object][object Object] public MyClient2(BruteForce bf , int num, int myPort, String password)[object Object] {[object Object] [object Object] hostname = new String("sec-crack.cs.rmit.edu.");[object Object] port = myPort;[object Object] status = 0;[object Object] myTime = 0;[object Object] myPassword = password;[object Object] filename = new String("/SEC/2/");[object Object] myMaster = 0;[object Object] n = num;[object Object] dif = 0;[object Object] [object Object] }[object Object] public getDif()[object Object] {[object Object] return dif;[object Object] }[object Object] public int getStatus()[object Object] {[object Object] return status;[object Object] }[object Object] public void run() [object Object] {[object Object] String inputLine;[object Object] String[] tokens = new String[5];[object Object] int i;[object Object] myTime = 0;[object Object] ... |
import java.io.[object Object];[object Object]import java.util.*;[object Object][object Object][object Object]public class Dictionary[object Object]{[object Object] public static void main (String args[])[object Object] {[object Object] [object Object] [object Object] Calendar cal = Calendar.getInstance();[object Object] Date now=cal.getTime();[object Object] double startTime = now.getTime();[object Object][object Object] String password=getPassword(startTime);[object Object] System.out.println("The password is " + password);[object Object] }[object Object][object Object] public static String getPassword(double startTime)[object Object] {[object Object] String password="";[object Object] int requests=0;[object Object][object Object] try[object Object] {[object Object] [object Object] FileReader fRead = new FileReader("/usr/share/lib/dict/words");[object Object] BufferedReader buf = new BufferedReader(fRead);[object Object][object Object] password=buf.readLine();[object Object][object Object] while (password != null)[object Object] {[object Object] [object Object] if (password.length()<=3)[object Object] {[object Object] requests++;[object Object] if (testPassword(password, startTime, requests))[object Object] return password;[object Object] }[object Object][object Object] password = buf.readLine();[object Object][object Object] }[object Object] }[object Object] catch (IOException ioe)[object Object] {[object Object][object Object] }[object Object][object Object] return password;[object Object] }[object Object][object Object] private static boolean testPassword(String password, double startTime, int requests)[object Object] {[object Object] try[object Object] {[object Object] [object Object] [object Object] U... | import java.io.[object Object];[object Object]import java.util.*;[object Object][object Object][object Object]public class BruteForce[object Object]{[object Object][object Object] public static void main(String args[])[object Object] {[object Object] [object Object] [object Object] Calendar cal = Calendar.getInstance();[object Object] Date now=cal.getTime();[object Object] double startTime = now.getTime();[object Object][object Object] String password=getPassword(startTime);[object Object] System.out.println("The password is " + password);[object Object] }[object Object][object Object] public static String getPassword(double startTime)[object Object] {[object Object] char first, second, third;[object Object] String password="";[object Object] int requests=0;[object Object][object Object] [object Object] for (int i=65; i<123; i++)[object Object] {[object Object] requests++;[object Object] first = (char) i;[object Object][object Object] password = first + "";[object Object][object Object] [object Object] if (testPassword(password, startTime, requests))[object Object] return password;[object Object][object Object] for (int j=65; j<123; j++)[object Object] {[object Object] requests++;[object Object] second = (char) j;[object Object][object Object] password = first + "" + second;[object Object][object Object] [object Object] if (testPassword(password, startTime, requests))[object Object] return password;[object Object][object Object] for (int k=65; k<123; k++)[object Object] {[object Object] requests++;[object Object] third = (char) k;[object Object][object Object] password = first + "" + second + "" + third;[object Object][object Object] [object Object] if (test... | [object Object][object Object]import java.misc.BASE64Encoder;[object Object]import java.misc.BASE64Decoder;[object Object]import java.io.[object Object];[object Object]import java.util.*;[object Object][object Object][object Object][object Object]public class Dictionary {[object Object] [object Object] public Dictionary(String url, String dictionaryFile) {[object Object] try{[object Object] this.url = url;[object Object] this.dictionaryPath = dictionaryFile;[object Object] InputStream fis = new FileInputStream(this.dictionaryPath);[object Object] dict = new BufferedReader(new InputStreamReader(fis));[object Object][object Object] }catch(IOException ioe){[object Object] System.out.println("Error opening dictionary file:\n" +ioe);[object Object] }[object Object] }[object Object][object Object][object Object] [object Object] private String url = null;[object Object] [object Object] private String dictionaryPath = null;[object Object] [object Object] private BufferedReader dict = null;[object Object] [object Object] private int attempts = 0;[object Object] [object Object] private int passwordSize = 3;[object Object] [object Object] public void setPasswordSize(int size){[object Object] this.passwordSize = size;[object Object] }[object Object] [object Object] public String getNextPassword()throws IOException{[object Object][object Object] String line = dict.readLine();[object Object][object Object] while(line!=null&&line.length()!=this.passwordSize )[object Object] line = dict.readLine();[object Object][object Object] return line;[object Object] }[object Object] [object Object] publ... |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "gather_across_devices": false
5}per_device_train_batch_size: 16num_train_epochs: 2warmup_ratio: 0.1fp16: Trueoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 8per_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: 1.0num_train_epochs: 2max_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}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_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: Falsehub_revision: Nonegradient_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: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | binary-class-evaluator_cosine_ap |
|---|---|---|---|
| -1 | -1 | - | 0.6070 |
| 0.0414 | 100 | 1.5692 | - |
| 0.0827 | 200 | 0.7166 | - |
| 0.1241 | 300 | 0.6628 | - |
| 0.1655 | 400 | 0.5978 | - |
| 0.2069 | 500 | 0.6028 | - |
| 0.2482 | 600 | 0.6467 | - |
| 0.2896 | 700 | 0.6132 | - |
| 0.3310 | 800 | 0.6031 | - |
| 0.3724 | 900 | 0.6189 | - |
| 0.4137 | 1000 | 0.6306 | - |
| 0.4551 | 1100 | 0.6175 | - |
| 0.4965 | 1200 | 0.5871 | - |
| 0.5379 | 1300 | 0.6065 | - |
| 0.5792 | 1400 | 0.6095 | - |
| 0.6206 | 1500 | 0.5812 | - |
| 0.6620 | 1600 | 0.5933 | - |
| 0.7034 | 1700 | 0.5713 | - |
| 0.7447 | 1800 | 0.5947 | - |
| 0.7861 | 1900 | 0.5966 | - |
| 0.8275 | 2000 | 0.5738 | - |
| 0.8688 | 2100 | 0.608 | - |
| 0.9102 | 2200 | 0.5769 | - |
| 0.9516 | 2300 | 0.5641 | - |
| 0.9930 | 2400 | 0.5825 | - |
| 1.0343 | 2500 | 0.5607 | - |
| 1.0757 | 2600 | 0.5986 | - |
| 1.1171 | 2700 | 0.5804 | - |
| 1.1585 | 2800 | 0.5752 | - |
| 1.1998 | 2900 | 0.5897 | - |
| 1.2412 | 3000 | 0.5563 | - |
| 1.2826 | 3100 | 0.5466 | - |
| 1.3240 | 3200 | 0.5798 | - |
| 1.3653 | 3300 | 0.5634 | - |
| 1.4067 | 3400 | 0.536 | - |
| 1.4481 | 3500 | 0.5915 | - |
| 1.4894 | 3600 | 0.6009 | - |
| 1.5308 | 3700 | 0.5925 | - |
| 1.5722 | 3800 | 0.5882 | - |
| 1.6136 | 3900 | 0.5872 | - |
| 1.6549 | 4000 | 0.5782 | - |
| 1.6963 | 4100 | 0.5595 | - |
| 1.7377 | 4200 | 0.5892 | - |
| 1.7791 | 4300 | 0.5581 | - |
| 1.8204 | 4400 | 0.5681 | - |
| 1.8618 | 4500 | 0.5982 | - |
| 1.9032 | 4600 | 0.582 | - |
| 1.9446 | 4700 | 0.5601 | - |
| 1.9859 | 4800 | 0.5649 | - |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{henderson2017efficient,
2 title={Efficient Natural Language Response Suggestion for Smart Reply},
3 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},
4 year={2017},
5 eprint={1705.00652},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}