buelfhood commited on
Commit
8cd1ac2
·
verified ·
1 Parent(s): 007a02d

Add new SentenceTransformer model

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,996 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - sentence-transformers
4
+ - sentence-similarity
5
+ - feature-extraction
6
+ - generated_from_trainer
7
+ - dataset_size:33411
8
+ - loss:BatchAllTripletLoss
9
+ base_model: huggingface/CodeBERTa-small-v1
10
+ widget:
11
+ - source_sentence: "\n\n\npublic class PasswordGen {\n \n private int iLastSeed\
12
+ \ = 0;\n private int iPasswordLength = 3;\n private String strPassword;\n\
13
+ \ \n \n public PasswordGen() {\n strPassword = \"\";\n }\n\
14
+ \ \n public boolean setSeed(int iSeedVal) {\n iLastSeed = iSeedVal;\n\
15
+ \ return true;\n }\n \n public String getPassword() {\n \
16
+ \ return strPassword;\n }\n \n public String getPassword(int iSeed)\
17
+ \ {\n int iRemainder, iAliquot, i;\n int arrChars[];\n boolean\
18
+ \ fDone;\n \n \n \n arrChars = new int[iPasswordLength];\n\
19
+ \ for(i = 0; i<iPasswordLength; i++)\n arrChars[i] = 0;\n\
20
+ \n fDone = false;\n iAliquot = iSeed;\n i=0;\n while(!fDone)\
21
+ \ {\n iRemainder = iAliquot % 52;\n if(iRemainder == 0)\
22
+ \ iRemainder=52;\n iAliquot = iAliquot / 52;\n \n \
23
+ \ arrChars[i] = iRemainder;\n if(i<iPasswordLength) i++;\n \
24
+ \ if(iAliquot == 0)\n fDone = true;\n }\n \
25
+ \ \n strPassword = convertPassword(arrChars);\n \n return\
26
+ \ strPassword;\n }\n \n public String getNextPassword() {\n iLastSeed++;\n\
27
+ \ strPassword = getPassword(iLastSeed);\n return strPassword;\n\
28
+ \ }\n \n private String convertPassword(int[] chars) {\n String strPwd;\n\
29
+ \ int i;\n \n strPwd = \"\";\n \n for(i=0;\
30
+ \ i<iPasswordLength; i++)\n {\n \n if(chars[i] !=\
31
+ \ 0)\n {\n if (chars[i] < 27)\n {\n \
32
+ \ strPwd += new Character((char)(chars[i]+64)).toString();\n\
33
+ \ }\n else\n {\n \
34
+ \ strPwd += new Character((char)(chars[i]+70)).toString();\n \
35
+ \ }\n }\n }\n return strPwd;\n }\n}\n"
36
+ sentences:
37
+ - "import java.io.*;\n\n\npublic class WatchDog\n{\npublic static void main (String[]\
38
+ \ args)\n{ String isdiff = new String();\n String[] cmd1 = {\"//sh\"\
39
+ ,\"-c\",\"diff newfile.html oldfile.html > diff.txt\"};\n String[] cmd2\
40
+ \ = {\"//sh\",\"-c\",\"mailx -s \\\"Web Changed\\\" \\\"@cs.rmit.edu.\\\" < diff.txt\"\
41
+ };\n\n try {\n\n\n while(true)\n {\n Runtime.getRuntime().exec(\"\
42
+ wget http://www.cs.rmit.edu./students/ -O oldfile.html\");\n Thread.sleep(43200000);\n\
43
+ \ Thread.sleep(43200000);\n Runtime.getRuntime().exec(\"\
44
+ wget http://www.cs.rmit.edu./students/ -O newfile.html\");\n Thread.sleep(2000);\n\
45
+ \ Runtime.getRuntime().exec(cmd1);\n Thread.sleep(2000);\n\
46
+ \ BufferedReader diff = new BufferedReader(new FileReader(\"diff.txt\"\
47
+ ));\n if ((isdiff=diff.readLine()) != null)\n {\n \
48
+ \ Runtime.getRuntime().exec(cmd2);\n System.out.println(\"\
49
+ Change Detected & Email Send\");\n }\n diff.print();\n\
50
+ \ }\n }\n\n catch (IOException err)\n {\n \
51
+ \ err.printStackTrace();\n }\n\n catch (InterruptedException\
52
+ \ err)\n {\n err.printStackTrace();\n }\n\n}\n\n\n}"
53
+ - "import java.io.*;\nimport java.net.*;\nimport java.util.*;\nimport java.*;\n\n\
54
+ \npublic class WatchDog {\n\n\npublic static final int interval = 79200000;\n\n\
55
+ public static void main(String[] args) {\n WatchDog wd = new WatchDog();\n\
56
+ \ Thread thread = new Thread();\n URLConnection conn = null;\n DataInputStream\
57
+ \ data = null;\n DataInputStream in = null;\n String line;\n String lines;\n\
58
+ \ String buffer = new String();\n String buffers = new String();\n String\
59
+ \ url = new String(\"http://www.cs.rmit.edu./students/\");\n boolean change;\n\
60
+ \ttry{\n\tURL myurl = new URL(url);\n conn = myurl.openConnection();\n\
61
+ \ conn.connect();\n Object content = null;\n \n System.out.println(\"\
62
+ Connection opened......\");\n System.out.println(\"Retrieving data from\
63
+ \ URL\");\n data = new DataInputStream(new BufferedInputStream(conn.getInputStream()));\n\
64
+ \ System.out.println(\" data from the URL......\");\n content =\
65
+ \ myurl.getContent();\n BufferedReader reader = null;\n\treader = new BufferedReader(new\
66
+ \ InputStreamReader((InputStream) content));\n\n \n while ((line\
67
+ \ = data.readLine()) != null)\n\n {\n System.out.println(line);\n\
68
+ \ FileWriter outnew = new FileWriter(\"watchdogresult.html\");\n \
69
+ \ outnew.write(line);\n }\n System.out.println(\"Waiting for\
70
+ \ any change....\");\n thread.sleep(79200000);\n conn = myurl.openConnection();\n\
71
+ \ conn.connect();\n in = new DataInputStream(new BufferedInputStream(conn.getInputStream()));\n\
72
+ \ while ((lines = in.readLine()) != null)\n {\n\n\t FileWriter newf\
73
+ \ = new FileWriter(\"watchdogresult.tmp\");\n newf.write(buffers);\n \
74
+ \ }\n\tchange = true;\n if(change);\n else{\n\tchange = false;\n\
75
+ \ \n\twd.mail();\n\t}\n}\n catch (InterruptedException e) {}\n catch (IOException\
76
+ \ e) {\n e.printStackTrace();\n String r = new String(e.getMessage());\n\
77
+ \ if ( r != null)\n {\n System.out.println(\"Message :\" +r);\n }\n\
78
+ \ else\n System.out.println(\"Other problems\");\n }\n }\n\n\npublic\
79
+ \ void mail(){\n\n try {\n\n String from = new String(\"Watchdog Reporter\"\
80
+ );\n String email = new String(\"@cs.rmit.edu.\");\n String subject\
81
+ \ = new String(\" is a change in \");\n\n \n URL u = new URL(\"mailto:\"\
82
+ \ + email);\n URLConnection c = u.openConnection();\n c.setDoInput(false);\n\
83
+ \ c.setDoOutput(true);\n System.out.println(\"Connecting...\");\n \
84
+ \ System.out.flush();\n c.connect();\n PrintWriter out =\n \
85
+ \ new PrintWriter(new OutputStreamWriter(c.getOutputStream()));\n\n \n \
86
+ \ out.println(\"From: \\\"\" + from + \"\\\" <\" +\n System.getProperty(\"\
87
+ user.name\") + \"@\" +\n InetAddress.getLocalHost().getHostName()\
88
+ \ + \">\");\n out.println(\": \" );\n out.println(\"Subject: \" + subject);\n\
89
+ \ out.println(); \n\n \n String line = new String(\"Watchdog observe\
90
+ \ that is a change in the web .\");\n out.close();\n System.out.println(\"\
91
+ Message sent.\");\n System.out.flush();\n }\n catch (Exception e) {\n\
92
+ \ System.err.println(e);\n }\n\n }\n\n}\n\n"
93
+ - "\n\nimport java.io.BufferedReader;\nimport java.io.FileReader;\n\nimport org.apache.commons.httpclient.HttpClient;\n\
94
+ import org.apache.commons.httpclient.UsernamePasswordCredentials;\nimport org.apache.commons.httpclient.cookie.CookiePolicy;\n\
95
+ import org.apache.commons.httpclient.methods.GetMethod;\n\n\n\n\npublic class\
96
+ \ Dictionary{\n static final String LOGON_SITE_HACKER = DictionaryPropertyHelper.getProperty(\"\
97
+ logonSite\");\n static final int LOGON_PORT_HACKER = Integer.valueOf(DictionaryPropertyHelper.getProperty(\"\
98
+ logonPort\")).intValue();\n\tstatic final String cad = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklumnopqrstuvwxyz\"\
99
+ ;\n\n static final int USE_PROXY_SERVER = Integer.valueOf(DictionaryPropertyHelper.getProperty(\"\
100
+ useProxyServer\")).intValue();\n static final int PROXY_PORT = Integer.valueOf(DictionaryPropertyHelper.getProperty(\"\
101
+ proxyPort\")).intValue();\n\n static final String PROXY_SERVER = DictionaryPropertyHelper.getProperty(\"\
102
+ proxyServer\");\n static final String PROXY_USENAME = DictionaryPropertyHelper.getProperty(\"\
103
+ proxyUserName\");\n static final String PROXY_PASSWORD = DictionaryPropertyHelper.getProperty(\"\
104
+ proxypassword\");\n\n\n\n static final String GET_METHOD_HACKER = DictionaryPropertyHelper.getProperty(\"\
105
+ getMethod\");\n static final int NUMBER_OF_GETS_BEFORE_RELEASE = Integer.valueOf(DictionaryPropertyHelper.getProperty(\"\
106
+ numberOfGetsBeforeReleaseConnection\")).intValue();\n\n\n public Dictionary()\
107
+ \ {\n super();\n }\n\n\n\n\n\n public static void main(String[] args)\
108
+ \ throws Exception {\n\n\t\tString statusLine = \" \";\n\t\tint count = 0;\n\t\
109
+ \tint divValue = 0;\n\n\t\tString userName = \"\";\n\t\tString password = \"\"\
110
+ ;\n\n\n HttpClient client = new HttpClient();\n\n if (USE_PROXY_SERVER\
111
+ \ == 1) {\n \t\t\tclient.getHostConfiguration().setProxy(PROXY_SERVER, PROXY_PORT);\n\
112
+ \ \t\t\tclient.getState().setProxyCredentials(null, null, new UsernamePasswordCredentials(PROXY_USENAME,\
113
+ \ PROXY_PASSWORD));\n\n }\n client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);\n\
114
+ \ client.getHostConfiguration().setHost(LOGON_SITE_HACKER, LOGON_PORT_HACKER,\
115
+ \ \"http\");\n GetMethod getMethod = new GetMethod(GET_METHOD_HACKER);\n\
116
+ \n\n\n\t\t\n \tBufferedReader wordFile = new BufferedReader(new FileReader(DictionaryPropertyHelper.getProperty(\"\
117
+ dictionaryFile\")));\n\n\t\twhile ((password = wordFile.readLine()) != null) {\n\
118
+ \n\n\t\t\tif (validateWord(password)) {\n\n\t\t\t\tclient.getState().setCredentials(null,\
119
+ \ null, new UsernamePasswordCredentials(userName, password));\n\t\t\t\t++count;\n\
120
+ \t\t\t\tSystem.out.println(\" Counter \" + count + \" Password \" + password);\n\
121
+ \n\t\t\t\tdivValue = count % NUMBER_OF_GETS_BEFORE_RELEASE;\n\n\t\t\t\tif (divValue\
122
+ \ == 0) {\n\n\n\n\t\t\t\t\tSystem.out.println(\"Count: \"+ count + \" Div Value:\
123
+ \ \"+ divValue+ \" Releasing the connection and getting new one\");\n\t\t\t\t\t\
124
+ getMethod.releaseConnection();\n\t\t\t\t\tgetMethod = null;\n\t\t\t\t\tgetMethod\
125
+ \ = new GetMethod(GET_METHOD_HACKER);\n\n\t\t\t\t}\n\n\t\t client.executeMethod(getMethod);\n\
126
+ \n\t\t statusLine = getMethod.getStatusLine().toString();\n\n\n\t\t\t\t\
127
+ \n\t\t\t\t\n\n\t\t\t\tif (statusLine.compareTo(\"HTTP/1.1 200 OK\") == 0) {\n\n\
128
+ \n\t\t\t\t\tSystem.out.println(\"Found the user name and password for the site.\
129
+ \ The username is: \"+ userName+ \" and the password is: \"+ password);\n\n\n\t\
130
+ \t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}\n\n\t\tSystem.out.println(\"\
131
+ Could not find the password!\");\n\n }\n\n\n\n\t\n\tpublic static boolean validateWord(String\
132
+ \ str) {\n\n\t\n\n\n\t\tboolean isValid = false;\n\n\t\t\n\t\tif (str.length()\
133
+ \ > 3) {\n\t\t\treturn isValid;\n\t\t}\n\n\t\tfor (int i = 0; i < str.length();\
134
+ \ i++) {\n\t\t\tfor (int j = 0; j < cad.length(); j++) {\n\t\t\t\tif (str.charAt(i)\
135
+ \ == cad.charAt(j)) {\n\t\t\t\t\tisValid = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\
136
+ \t\t\t\telse\n\t\t\t\t\tisValid = false;\n\t\t\t}\n\t\t\tif (!isValid)\n\t\t\t\
137
+ \tbreak;\n\t\t}\n\t\treturn isValid;\n\t}\n\n\n}\n"
138
+ - source_sentence: "\n\n\n\n\n\nimport java.util.*;\nimport java.io.*;\nimport java.net.*;\n\
139
+ \npublic class MyWatchDogTimer extends TimerTask\n{\n\tpublic void run()\n\t{\n\
140
+ \t Runtime rt = Runtime.getRuntime();\n\t Process prss= null;\n\t String initialmd5,presentmd5,finalmd5,temp1;\n\
141
+ \ String mesg1 = new String();\n String subject = new String(\"\
142
+ Report of WatchDog\");\n\n\t int i;\n \n\t try\n {\n\n \
143
+ \ prss = rt.exec(\"md5sum first.html\");\n\n InputStreamReader\
144
+ \ instre1 = new InputStreamReader(prss.getInputStream());\n BufferedReader\
145
+ \ bufread1 = new BufferedReader(instre1);\n\t\t \n sw = bufread1.readLine();\n\
146
+ \t i = finalmd5.indexOf(' ');\n\t initialmd5 = finalmd5.substring(0,i);\n\
147
+ \t System.out.println(\"this is of first.html--->\"+initialmd5);\n\t\t \
148
+ \ \n\n\t\t \n prss = rt.exec(\"wget -R mpg,mpeg, --output-document=present.html\
149
+ \ http://www.cs.rmit.edu./students/\");\n\n\t\t \n prss = rt.exec(\"\
150
+ md5sum present.html\");\n\t\t \n InputStreamReader instre2 = new\
151
+ \ InputStreamReader(prss.getInputStream());\n BufferedReader bufread2\
152
+ \ = new BufferedReader(instre2);\n\t\t \n\t temp1 = bufread2.readLine();\n\
153
+ \t i = temp1.indexOf(' ');\n\t presentmd5 = temp1.substring(0,i);\n\t\
154
+ \ System.out.println(\"this is of present.html---->\"+presentmd5);\n\t\t\n\
155
+ \ \n if(initialmd5.equals(presentmd5))\n \
156
+ \ System.out.println(\"The checksum found using md5sum is same\");\n\t\t else\n\
157
+ \t\t {\n\t\t prss = rt.exec(\"diff first.html present.html > diff.html\"\
158
+ );\n System.out.println(\" is different\"); \n \
159
+ \ prss = null;\n mesg1 =\"php mail.php\";\n\t\t \
160
+ \ prss = rt.exec(mesg1);\n\t\t } \n\n prss = rt.exec(\"\
161
+ rm present.*\");\n\n \t }catch(java.io.IOException e){}\n\n }\n\
162
+ }\t\t\n"
163
+ sentences:
164
+ - "import java.io.*;\nimport java.net.*;\nimport java.net.HttpURLConnection;\nimport\
165
+ \ javax.net.*;\nimport java.security.cert.*;\n\npublic class Dictionary\n{\n\t\
166
+ public static void main(String[] args)\n\t{\n\t\tBufferedReader in = null;\n\t\
167
+ \tboolean found = true;\n\t\tString word = null;\n\t\tString cmd = null;\n\t\t\
168
+ Runtime run = Runtime.getRuntime();\n\t\tProcess pro = null;\n\t\tBufferedReader\
169
+ \ inLine = null;\n\n\n\n\t\tString str = null;\n\t\tURLConnection connection =\
170
+ \ null;\n\n\t\ttry\n\t\t{\n\t\t\tFileReader reader = new FileReader(\"words\"\
171
+ );\n\t\t\tin = new BufferedReader(reader);\n\t\t\tSystem.out.println(\" cracking....\"\
172
+ );\n\t\t\t\n\t\t\t{\n\t\t\t\tfound = true;\n\t\t\t\tword = new String(in.readLine());\n\
173
+ \n\t\t\t\tcmd = \"wget --http-user= --http-passwd=\"+word +\" http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\
174
+ ;\n\n\t\t\t\tpro = run.exec(cmd);\n\t\t\t\tinLine = new BufferedReader(new InputStreamReader(pro.getErrorStream()));\n\
175
+ \n\n\t\t\t\tif((str=inLine.readLine())!=null)\n\t\t\t\t{\n\n\t\t\t\t\twhile ((str=inLine.readLine())!=null)\n\
176
+ \t\t\t\t\t{\n\t\t\t\t\t\tif (str.endsWith(\"Required\"))\n\t\t\t\t\t\t{\n\n\t\t\
177
+ \t\t\t\t\tfound = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\n\n\n\n\
178
+ \t\t\t\trun.gc();\n\t\t\t}\n\t\t\twhile (!found);\n\n\n\n\n\n\t\t}\n\t\tcatch\
179
+ \ (FileNotFoundException exc)\n\t\t{\n\t\t\tSystem.out.println(exc);\n\t\t}\n\t\
180
+ \tcatch (IOException exc)\n\t\t{\n\t\t\tSystem.out.println(exc);\n\t\t}\n \
181
+ \ catch (NullPointerException ex)\n {\n System.out.println(word);\n\
182
+ \ }\n\t\tfinally\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (in!= null)\n\t\
183
+ \t\t\t{\n\t\t\t\t\tin.print();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e)\
184
+ \ {}\n\t\t}\n\t\tif (found == true)\n\t\t\tSystem.out.println(\"The password is\
185
+ \ :\" + word);\n else\n System.out.println(\"NOT FOUND!\");\n\
186
+ \t}\n}"
187
+ - "\n\nimport java.net.*;\nimport java.io.*;\n\t\n\nclass MyAuthenticator extends\
188
+ \ Authenticator {\n\n String password;\n\n public MyAuthenticator(String pwdin)\
189
+ \ {\n password = pwdin;\n }\n \n protected PasswordAuthentication\
190
+ \ getPasswordAuthentication(){\n\tString pwd = password;\n\treturn new PasswordAuthentication(\"\
191
+ \",pwd.toCharArray());\n }\n}\n"
192
+ - "\n\nimport java.net.*;\nimport java.io.*;\nimport java.io.IOException;\nimport\
193
+ \ java.util.*;\nimport java.*;\n\n\npublic class BruteForce {\n public static\
194
+ \ void main (String[] args) throws Exception {\n int maxChar = 26, counter=0,\
195
+ \ x =0, attempt =0 ;\n String guess = new String();\n String pass, inputLine;\n\
196
+ \ String letter[] = {\"\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\"\
197
+ , \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\",\n \
198
+ \ \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\"\
199
+ , \"z\" , \"A\", \"B\", \"C\", \"D\", \"E\"\n , \"F\", \"\
200
+ G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"\
201
+ R\", \"S\", \"T\", \"U\", \"V\",\n \"W\", \"X\", \"Y\", \"\
202
+ Z\"};\n\n boolean flag=false;\n\n System.out.println(System.currentTimeMillis()/1000);\n\
203
+ \n for (int i=0; i<maxChar ; i++){\n for (int\
204
+ \ j=0 ; j<maxChar ; j++){\n for (int k=0 ; k<maxChar ; k++){\n\
205
+ \ guess = letter[i]+letter[j]+letter[k];\n \
206
+ \ attempt++;\n System.out.println(guess);\n\
207
+ \ pass = \":\" + guess;\n \
208
+ \ String password = new bf.misc.BASE64Encoder().encode(pass.getBytes());\n\
209
+ \ try{\n URL u =\
210
+ \ new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/\");\n \
211
+ \ URLConnection yc = u.openConnection();\n \
212
+ \ yc.setRequestProperty(\"Authorization\",\" \"+password);\n \
213
+ \ BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));\n\
214
+ \ while ((inputLine = in.readLine()) != null)\n\
215
+ \ System.out.println(inputLine);\n \
216
+ \ in.print();\n System.out.println(guess);\n\
217
+ \ System.out.println(System.currentTimeMillis()/1000);\n\
218
+ \ System.out.println(\" of attempt: \"+attempt);\n\
219
+ \ System.exit(0);\n\n \
220
+ \ }catch(IOException e){ }\n }\n }\n\
221
+ \ }\n }\n}"
222
+ - source_sentence: "import java.io.*;\nimport java.net.*;\nimport java.*;\nimport\
223
+ \ java.Runtime.*;\nimport java.Object.*;\nimport java.util.*;\nimport java.util.StringTokenizer;\n\
224
+ \npublic class Dictionary \n{\n String uname = \"\";\n String pword = \"null\"\
225
+ ;\n Vector v = new Vector();\n int runTime;\n public void doConnect(String\
226
+ \ connect, int num)\n {\n String = connect;\n \n try\n {\n \
227
+ \ URL secureSite = new URL();\n URLConnection connection = secureSite.openConnection();\n\
228
+ \ if (uname != null || pword != null)\n\t {\n\t \n\t for(int i=num;\
229
+ \ i<v.size(); i++)\n\t {\n\t pword = (String)v.elementAt(i);\n\t \
230
+ \ String up = uname + \":\" + pword;\n String encoding;\n \
231
+ \ try\n\t\t{\n\t\t connection.misc.BASE64Encoder encoder = (con.misc.BASE64Encoder)\
232
+ \ Class.forName(\".misc.BASE64Encoder\").newInstance();\n\t\t encoding = encoder.encode\
233
+ \ (up.getBytes());\n\t\t \n }\n\t catch (Exception ex) \n \
234
+ \ {\n\t\t Base64Converter encoder = new Base64Converter();\n\t\t System.out.println(\"\
235
+ in catch\");\n encoding = encoder.encode(up.getBytes());\n \
236
+ \ }\n\t connection.setRequestProperty (\"Authorization\", \" \" + encoding);\n\
237
+ \ connection.connect();\n if(connection instanceof HttpURLConnection)\n\
238
+ \t {\n\t HttpURLConnection httpCon=(HttpURLConnection)connection;\n\
239
+ \ if(httpCon.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED)\n\
240
+ \t\t {\n\t\t System.out.println(\"Not authorized - check for details\" + \"\
241
+ \ -Incorrect Password : \" + pword);\n\t doConnect(i, i+1);\n\t \
242
+ \ }\n\t\telse\n\t\t { \n\t\t System.out.println(\"\\n\\n\\nPassword for HTTP\
243
+ \ Secure Site by Dictionary Attack:\");\n\t System.out.println( +\"\\tPassword\
244
+ \ : \"+ pword);\n\n runTime = System.currentTimeMillis() - runTime;\
245
+ \ \n System.out.println(\"Time taken crack password (in seconds)\"\
246
+ +\" : \"+ runTime/1000+\"\\n\"+ \"Tries taken crack password : \"+ i);\n\t \
247
+ \ System.exit(0);\n\t }\n\t }\n\t }\n }\n }\n catch(Exception\
248
+ \ ex)\n {\n ex.printStackTrace();\n }\n }\n public Vector getPassword()\n\
249
+ \ {\n try\n {\n ReadFile rf = new ReadFile();\n rf.loadFile();\n\
250
+ \ v = rf.getVector();\n }\n catch(Exception ex)\n {\n ex.printStackTrace();\n\
251
+ \ }\n return v;\n } \n public void setTimeTaken( int timetaken)\n {\n\
252
+ \ runTime = timetaken;\n } \n public static void main ( String args[] )\
253
+ \ throws IOException \n {\n \n runTime1 = System.currentTimeMillis();\
254
+ \ \n Dictionary newDo = new Dictionary();\n newDo.setTimeTaken(runTime1);\n\
255
+ \ newDo. getPassword();\n String site = \"http://sec-crack.cs.rmit.edu./SEC/2/\"\
256
+ ;\n newDo.doConnect(site, 0);\n \n } \n \n}\n\nclass Base64Converter\n\
257
+ \ {\n \n public final char [ ] alphabet = {\n 'A',\
258
+ \ 'B', 'C', 'D', 'E', 'F', 'G', 'H', \n 'I', 'J', 'K', 'L', 'M',\
259
+ \ 'N', 'O', 'P', \n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', \n\
260
+ \ 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', \n 'g',\
261
+ \ 'h', 'i', 'j', 'k', 'l', 'm', 'n', \n 'o', 'p', 'q', 'r', 's',\
262
+ \ 't', 'u', 'v', \n 'w', 'x', 'y', 'z', '0', '1', '2', '3', \n\
263
+ \ '4', '5', '6', '7', '8', '9', '+', '/' }; \n \n \n public\
264
+ \ String encode ( String s )\n {\n return encode ( s.getBytes\
265
+ \ ( ) );\n }\n \n public String encode ( byte [ ] octetString\
266
+ \ )\n {\n int bits24;\n int bits6;\n \n\
267
+ \ char [ ] out\n = new char [ ( ( octetString.length\
268
+ \ - 1 ) / 3 + 1 ) * 4 ];\n \n int outIndex = 0;\n int\
269
+ \ i = 0;\n \n while ( ( i + 3 ) <= octetString.length ) {\n\
270
+ \ \n bits24=( octetString [ i++ ] & 0xFF ) <<\
271
+ \ 16;\n bits24 |=( octetString [ i++ ] & 0xFF ) << 8;\n \n \
272
+ \ bits6=( bits24 & 0x00FC0000 )>> 18;\n out [\
273
+ \ outIndex++ ] = alphabet [ bits6 ];\n bits6 = ( bits24 & 0x0003F000\
274
+ \ ) >> 12;\n out [ outIndex++ ] = alphabet [ bits6 ];\n \
275
+ \ bits6 = ( bits24 & 0x00000FC0 ) >> 6;\n out [ outIndex++\
276
+ \ ] = alphabet [ bits6 ];\n bits6 = ( bits24 & 0x0000003F );\n\
277
+ \ out [ outIndex++ ] = alphabet [ bits6 ];\n }\n\
278
+ \ \n if ( octetString.length - i == 2 )\n {\n \
279
+ \ \n bits24 = ( octetString [ i ] & 0xFF ) <<\
280
+ \ 16;\n bits24 |=( octetString [ i + 1 ] & 0xFF ) << 8;\n \
281
+ \ bits6=( bits24 & 0x00FC0000 )>> 18;\n out [ outIndex++\
282
+ \ ] = alphabet [ bits6 ];\n bits6 = ( bits24 & 0x0003F000 ) >>\
283
+ \ 12;\n out [ outIndex++ ] = alphabet [ bits6 ];\n \
284
+ \ bits6 = ( bits24 & 0x00000FC0 ) >> 6;\n out [ outIndex++\
285
+ \ ] = alphabet [ bits6 ];\n \n \n out [ outIndex++\
286
+ \ ] = '=';\n }\n else if ( octetString.length - i ==\
287
+ \ 1 )\n {\n \n bits24 = ( octetString\
288
+ \ [ i ] & 0xFF ) << 16;\n bits6=( bits24 & 0x00FC0000 )>> 18;\n\
289
+ \ out [ outIndex++ ] = alphabet [ bits6 ];\n \
290
+ \ bits6 = ( bits24 & 0x0003F000 ) >> 12;\n out [ outIndex++\
291
+ \ ] = alphabet [ bits6 ];\n \n \n out [ outIndex++\
292
+ \ ] = '=';\n out [ outIndex++ ] = '=';\n }\n \n\
293
+ \ return new String ( out );\n }\n }\n \n \n"
294
+ sentences:
295
+ - "\nimport java.net.*;\nimport java.*;\nimport java.io.*;\nimport java.util.GregorianCalendar;\n\
296
+ public class Dictionary\n{\n\n\n\n public void crackAddress(String fileName)\
297
+ \ throws Exception\n {\n String line,username=\"\",passwd,pass;\n \
298
+ \ int flag=0,i;\n BufferedReader bf = new BufferedReader(new FileReader(fileName));\n\
299
+ \ Runtime run = Runtime.getRuntime();\n GregorianCalendar =new GregorianCalendar();\n\
300
+ \ while((passwd=bf.readLine().trim())!=null)\n {\n if((i=passwd.indexOf(\"\
301
+ \\'\"))!= -1)\n {\n passwd =passwd.substring(0,i)+(\"\
302
+ \\\\\")+(passwd.substring(i,passwd.length()));\n }\n\n \
303
+ \ System.out.println(\"Hack password with the word:\"+passwd);\n\t String\
304
+ \ command_line = \"lynx http://sec-crack.cs.rmit.edu./SEC/2/ -auth=\"+username+\"\
305
+ :\"+passwd+\" -dump\";\n\t Process result = run.exec(command_line);\n \
306
+ \ BufferedReader bf = new BufferedReader(new InputStreamReader(result.getInputStream()));\n\
307
+ \n while((line=bf.readLine())!=null)\n {\n flag=1;\n \
308
+ \ break;\n\n }\n if(flag==1)\n {\n System.out.println(\"\
309
+ The username is: \"+username+\" The password is: \"+passwd);\n break;\n\
310
+ \ }\n }\n GregorianCalendar end=new GregorianCalendar();\n\
311
+ \ double time = (double)(end.getTimeInMillis()-System.getTimeInMillis())/1e3;\n\
312
+ \ System.out.println(\"The attack use\"+time+\" seconds.\");\n }\n\n\
313
+ public static void main(String args[]) throws Exception\n{\n Dictionary ds =\
314
+ \ new Dictionary();\n ds.crackAddress(args[0]);\n}\n}"
315
+ - "\n\nimport java.io.*;\nimport java.util.*;\nimport java.*;\n\npublic class storeNewFile\n\
316
+ {\n private PrintWriter outputStream= null;\n private String filename;\n \
317
+ \ private FileWriter fw;\n\n public storeNewFile(String fname)\n {\n \
318
+ \ try\n {\n filename = fname;\n outputStream=new PrintWriter(new\
319
+ \ FileOutputStream(filename));\n }\n catch(FileNotFoundException e)\n\
320
+ \ {\n\t System.err.println(\"File \"+filename+\" was not found\");\n \
321
+ \ }\n catch(IOException e)\n {\n System.err.println(\"Error\
322
+ \ \");\n }\n }\n public void getStringW(StringWriter sw)\n {\n \
323
+ \ outputStream.print(sw.toString());\n }\n\n public void closeStream()\n \
324
+ \ {\n outputStream.write();\n }\n\n public void translogFile(String\
325
+ \ result)\n {\n String fileName = \"TransactionLog.txt\";\n \t try{\n\t\
326
+ \ fw=new FileWriter(fileName,true);\n\t fw.write(result);\n\t fw.write('\\\
327
+ n');\n\t fw.print();\n \t System.out.println(\"Saved sucessfully\");\n\
328
+ \ }catch(IOException e){\n\t\tSystem.out.println(\"Error saving the file\"\
329
+ );\n }\n }\n}"
330
+ - "\n\nimport java.*;\nimport java.io.*;\nimport java.util.*;\n\npublic class Dictionary\n\
331
+ {\n public String[] passwds;\n public int passwdNum;\n public static void main(String[]\
332
+ \ args) throws IOException\n {\n Dictionary dic=new Dictionary();\n dic.doDictionary();\n\
333
+ \ System.exit(1);\n }\n\n void doDictionary() throws IOException\n {\n Runtime\
334
+ \ rt=Runtime.getRuntime();\n passwds=new String[32768];\n passwdNum=0;\n\n \
335
+ \ time1=new Date().getTime();\n \n try\n {\n\t\tFile f = new File (\"words\"\
336
+ );\n\t\tFileReader fin = new FileReader (f);\n\t\tBufferedReader buf = new BufferedReader(fin);\n\
337
+ \t\tpasswds[0]=\"00\";\n\t\tSystem.out.println(\" loading words....\");\n\t\t\n\
338
+ \t\t{\n\t\t passwds[passwdNum]=buf.readLine();\n\t\t\t passwdNum++;\n\t\t}while(passwds[passwdNum-1]!=null);\n\
339
+ \t\tSystem.out.println(\"Finish loading words.\");\n } catch (FileNotFoundException\
340
+ \ exc) {\n System.out.println (\"File Not Found\");\n } catch (IOException\
341
+ \ exc) {\n System.out.println (\"IOException 1\");\n } catch (NullPointerException\
342
+ \ exc) {\n\t System.out.println (\"NullPointerException\");\n }\n\n\t System.out.println(\"\
343
+ \ cracking....\");\n\t for(int i=0;i<passwdNum;i++)\n\t {\n\t\ttry\n\t\t{\n\t\t\
344
+ \t\n\t\t\tProcess p=rt.exec(\"lynx -auth=:\"+passwds[i]+\" -source http://sec-crack.cs.rmit.edu./SEC/2/index.php\"\
345
+ );\n\t\t\t\n\t\t\tString ln = (new BufferedReader(new InputStreamReader(p.getInputStream()))).readLine();\n\
346
+ \t\t\tp.destroy();\n\n\t\t\tif(ln!=null)\n\t\t\t\n\t\t\tif(ln.toCharArray()[0]=='C'&&ln.toCharArray()[1]=='o')\n\
347
+ \t\t\t{\n\t\t\t System.out.println(\"Finish cracking.\");\n\t\t\t System.out.println(ln);\n\
348
+ \t\t\t System.out.println(\"Password is \"+passwds[i]);\n\t\t\t break;\n\t\t\t\
349
+ }\n\t\t} catch (FileNotFoundException exc) {\n\t\t\t\ti--;\n\t\t} catch (IOException\
350
+ \ exc) {\n\t\t\t\ti--;\n\t\t} catch (NullPointerException exc) {\n\t\t\t\ti--;\n\
351
+ \t\t}\n\n\t }\n\n time2=new Date().getTime();\n System.out.println(\"costs\
352
+ \ \"+(time2-time1)+\" milliseconds\");\n }\n\n}"
353
+ - source_sentence: "import java.io.*;\nimport java.net.*;\n\npublic class BruteForce\
354
+ \ {\n public static void main(String[] args) {\n BruteForce brute=new BruteForce();\n\
355
+ \ brute.start();\n\n\n }\n\n\npublic void start() {\nchar passwd[]= new\
356
+ \ char[3];\nString password;\nString username=\"\";\nString auth_data;\nString\
357
+ \ server_res_code;\nString required_server_res_code=\"200\";\nint cntr=0;\n\n\
358
+ try {\n\nURL url = new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/\");\nURLConnection\
359
+ \ conn=null;\n\n\n for (int i=65;i<=122;i++) {\n if(i==91)\
360
+ \ { i=i+6; }\n passwd[0]= (char) i;\n\n for (int j=65;j<=122;j++)\
361
+ \ {\n if(j==91) { j=j+6; }\n passwd[1]=(char) j;\n\
362
+ \n for (int k=65;k<=122;k++) {\n if(k==91) { k=k+6;\
363
+ \ }\n passwd[2]=(char) k;\n password=new String(passwd);\n\
364
+ \ password=password.trim();\n auth_data=null;\n\
365
+ \ auth_data=username + \":\" + password;\n auth_data=auth_data.trim();\n\
366
+ \ auth_data=getBasicAuthData(auth_data);\n auth_data=auth_data.trim();\n\
367
+ \ conn=url.openConnection();\n conn.setDoInput (true);\n\
368
+ \ conn.setDoOutput(true);\n conn.setRequestProperty(\"\
369
+ GET\", \"/SEC/2/ HTTP/1.1\");\n conn.setRequestProperty (\"Authorization\"\
370
+ , auth_data);\n server_res_code=conn.getHeaderField(0);\n \
371
+ \ server_res_code=server_res_code.substring(9,12);\n \
372
+ \ server_res_code.trim();\n cntr++;\n System.out.println(cntr\
373
+ \ + \" . \" + \"PASSWORD SEND : \" + password + \" SERVER RESPONSE : \" + server_res_code);\n\
374
+ \ if( server_res_code.compareTo(required_server_res_code)==0 )\n\
375
+ \ {System.out.println(\"PASSWORD IS : \" + password + \" SERVER\
376
+ \ RESPONSE : \" + server_res_code );\n i=j=k=123;}\n \
377
+ \ }\n\n \
378
+ \ }\n\n }\n }\n catch (Exception\
379
+ \ e) {\n System.err.print(e);\n }\n }\n\npublic String getBasicAuthData\
380
+ \ (String getauthdata) {\n\nchar base64Array [] = {\n 'A', 'B', 'C', 'D',\
381
+ \ 'E', 'F', 'G', 'H',\n 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',\n 'Q',\
382
+ \ 'R', 'S', 'T', 'U', 'V', 'W', 'X',\n 'Y', 'Z', 'a', 'b', 'c', 'd', 'e',\
383
+ \ 'f',\n 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n 'o', 'p', 'q', 'r',\
384
+ \ 's', 't', 'u', 'v',\n 'w', 'x', 'y', 'z', '0', '1', '2', '3',\n '4',\
385
+ \ '5', '6', '7', '8', '9', '+', '/' } ;\n\n String encodedString = \"\";\n\
386
+ \ byte bytes [] = getauthdata.getBytes ();\n int i = 0;\n int pad = 0;\n\
387
+ \ while (i < bytes.length) {\n byte b1 = bytes [i++];\n byte b2;\n\
388
+ \ byte b3;\n if (i >= bytes.length) {\n b2 = 0;\n b3\
389
+ \ = 0;\n pad = 2;\n }\n else {\n b2 = bytes [i++];\n\
390
+ \ if (i >= bytes.length) {\n b3 = 0;\n pad = 1;\n\
391
+ \ }\n else\n b3 = bytes [i++];\n }\n \
392
+ \ byte c1 = (byte)(b1 >> 2);\n byte c2 = (byte)(((b1 & 0x3) << 4) | (b2\
393
+ \ >> 4));\n byte c3 = (byte)(((b2 & 0xf) << 2) | (b3 >> 6));\n byte\
394
+ \ c4 = (byte)(b3 & 0x3f);\n encodedString += base64Array [c1];\n encodedString\
395
+ \ += base64Array [c2];\n switch (pad) {\n case 0:\n encodedString\
396
+ \ += base64Array [c3];\n encodedString += base64Array [c4];\n \
397
+ \ break;\n case 1:\n encodedString += base64Array [c3];\n \
398
+ \ encodedString += \"=\";\n break;\n case 2:\n encodedString\
399
+ \ += \"==\";\n break;\n }\n }\n return \" \" + encodedString;\n\
400
+ \ }\n}"
401
+ sentences:
402
+ - "import java.net.*;\nimport java.io.*;\nimport java.util.*;\n\npublic class Dictionary\
403
+ \ {\n\n public static void main(String[] args) {\n new CrackAttempt();\n\
404
+ \ }\n}\n\nclass CrackAttempt {\n public CrackAttempt() {\n final int\
405
+ \ MAX_LENGTH = 3;\n boolean auth = false;\n Date = new Date();\n \
406
+ \ String file = \"/usr/share/lib/dict/words\";\n String word;\n char[]\
407
+ \ password = new char[MAX_LENGTH];\n String resource = \"http://sec-crack.cs.rmit.edu./SEC/2/\"\
408
+ ;\n\n while (!auth) {\n \n BufferedReader in = null;\n \
409
+ \ try {\n \n in = new BufferedReader(new FileReader(file));\n\
410
+ \ while ((word = in.readLine()) != null && !auth) {\n \
411
+ \ try {\n if (word.length() <= MAX_LENGTH) {\n \
412
+ \ password = word.toCharArray();\n \n \
413
+ \ Authenticator.setDefault(new CrackAuth(password));\n \
414
+ \ URL url = new URL(resource);\n HttpURLConnection conn\
415
+ \ = (HttpURLConnection)url.openConnection();\n conn.setRequestMethod(\"\
416
+ HEAD\");\n if (conn.getResponseCode() == HttpURLConnection.HTTP_OK)\
417
+ \ {\n System.out.println(\"cracked with \" + new String(password));\n\
418
+ \ auth = true;\n }\n \
419
+ \ }\n } catch (Exception e) {\n System.out.println(\"\
420
+ \ was exception: \" + e.getMessage());\n }\n }\n\n \
421
+ \ \n } catch (FileNotFoundException fnfe) {\n System.out.println(\"\
422
+ File Not Found\");\n } catch (IOException ioe) {\n System.out.println(\"\
423
+ IOException\");\n } catch(Exception e) {\n e.printStackTrace();\n\
424
+ \ } finally {\n try {\n in.close();\n \
425
+ \ } catch (Exception e) {;}\n }\n\n\n }\n if (!auth) {\n\
426
+ \ System.out.println(\"Unable determine password\");\n } else {\n\
427
+ \ time = (new Date()).getTime() - start.getTime();\n System.out.println(\"\
428
+ it took \" + String.valueOf(time) + \" milliseconds crack the password\");\n\
429
+ \ }\n }\n}\n\nclass CrackAuth extends Authenticator {\n char[] password;\n\
430
+ \ public CrackAuth(char[] password) {\n this.password = password;\n }\n\
431
+ \n protected PasswordAuthentication getPasswordAuthentication()\n {\n \
432
+ \ String user = \"\";\n return new PasswordAuthentication(user, password);\n\
433
+ \ }\n}\n"
434
+ - "\n\nimport java.io.*;\nimport java.util.*;\nimport java.net.*;\n\n\npublic class\
435
+ \ Dictionary {\n\n\tpublic static void main(String[] args) {\n\n\tString attackURL\
436
+ \ = \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\";\n\tString userID = \"\"\
437
+ ;\n\tString Password=\"\";\n\tString userPassword=\"\";\n\n\tFile inputFile =\
438
+ \ new File(\"/usr/share/lib/dict/words\");\n FileReader fin = null;\n \
439
+ \ BufferedReader bf = null;\n\n\ttry {\n\t\t startmillisecond = System.currentTimeMillis();\n\
440
+ \t URL url = new URL(attackURL);\n\t fin = new FileReader(inputFile);\n\
441
+ \t bf = new BufferedReader(fin);\n\t\tint count = 0;\n\t while ((Password\
442
+ \ = bf.readLine()) !=null) {\n\t if (Password.length() < 4) {\n\
443
+ \t\t\t\tcount++;\n\t\t\t\ttry {\n\t\t\t\t\tuserPassword = userID + \":\" + Password;\n\
444
+ \t\t\t\t\tSystem.out.println(\"User & Password :\" + userPassword);\n\t\t\t\t\
445
+ \ String encoding = Base64Converter.encode (userPassword.getBytes());\n\
446
+ \t\t\t\t\n\t\t\t\t\tURLConnection uc = url.openConnection();\n\t\t\t\t\tuc.setRequestProperty\
447
+ \ (\"Authorization\", \" \" + encoding);\n\t\t\t\t\tInputStream content = (InputStream)uc.getInputStream();\n\
448
+ \t\t\t\t\tBufferedReader in = new BufferedReader (new InputStreamReader (content));\n\
449
+ \t\t\t\t\tString line;\n\t\t\t\t\twhile ((line = in.readLine()) != null) {\n\t\
450
+ \t\t \n\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t }\n\t\t\
451
+ \t\t\t endmillisecond = System.currentTimeMillis();\n\t\t\t\t\t searchmillisecond\
452
+ \ = endmillisecond - startmillisecond;\n\t\t\t\t\tSystem.out.println(\"Match in\
453
+ \ \" + searchmillisecond + \" milliseconds \");\n\t\t\t\t\tSystem.out.println(\"\
454
+ Try in \" + count + \" times \");\n\t\t System.exit(1);\n\n\t\t\
455
+ \t\t} catch (MalformedURLException e) {\n\t\t\t \t\tSystem.out.println(\"\
456
+ Invalid URL\");\n\t\t\t\t} catch (IOException e) {\n\t\t \t\t\tSystem.out.println(\"\
457
+ Error URL\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tcatch (Exception ioe) {\n \
458
+ \ \tSystem.out.println(ioe.getMessage());\n }\n finally\
459
+ \ {\n }\n }\n\n}\n"
460
+ - "\n\n\n\nimport java.net.*;\nimport java.io.*;\nimport java.util.Date;\n\npublic\
461
+ \ class BruteForce {\n private URL url;\n private HttpURLConnection connection;\n\
462
+ \ private static String[] lowerCase = {\"a\", \"b\", \"c\", \"d\", \"e\", \"\
463
+ f\", \"g\", \"h\", \"i\", \"j\",\n \"k\"\
464
+ , \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\",\n \
465
+ \ \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"};\n private\
466
+ \ static String[] upperCase = {\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\"\
467
+ , \"H\", \"I\", \"J\",\n \"K\", \"L\", \"\
468
+ M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\",\n \
469
+ \ \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"};\n private String\
470
+ \ userPassword, base64_userPassword;\n private static char wrongPass;\n\n public\
471
+ \ BruteForce() {\n wrongPass = 'Y';\n }\n\n public char determinePass(String\
472
+ \ inputURL, String userName, String passWord){\n\n try{\n url = new\
473
+ \ URL(inputURL);\n connection = (HttpURLConnection)url.openConnection();\n\
474
+ \ this.getEncoded(userName, passWord);\n connection.setDoInput(true);\n\
475
+ \ connection.setDoOutput(false);\n connection.setRequestProperty(\"\
476
+ Authorization\",\n \" \" + base64_userPassword);\n\
477
+ \n if (connection.getResponseCode() == 200)\n {\n System.out.println(\"\
478
+ Success!! Password is: \" + passWord);\n wrongPass = 'N';\n }\n\
479
+ \n return wrongPass;\n }\n catch (MalformedURLException e){System.out.println(\"\
480
+ Invalide url\");}\n catch (IOException e){System.out.println(\"Error URL\"\
481
+ );\n wrongPass = 'Y';}\n return wrongPass;\n }\n\n\
482
+ \ public static void main(String[] args) {\n int i, j, k;\n String brutePass;\n\
483
+ \n BruteForce bruteForce1 = new BruteForce();\n\n Date date = new Date(System.currentTimeMillis());\n\
484
+ \ System.out.print(\" time is: \");\n System.out.println(date.toString());\n\
485
+ \ \n \n \n\n \n for (i = 0; i < 26; i++)\n { for (j = 0; j\
486
+ \ < 26; j++)\n { for (k = 0; k < 26; k++)\n {\n brutePass\
487
+ \ = lowerCase[i] + lowerCase[j] + lowerCase[k];\n bruteForce1.determinePass(args[0],\
488
+ \ args[1], brutePass);\n if (wrongPass == 'N')\n { i = 26;\n\
489
+ \ j = 26;\n k = 26;\n }}}}\n\n if (wrongPass\
490
+ \ == 'N')\n {\n date.setTime(System.currentTimeMillis());\n System.out.print(\"\
491
+ End time is: \");\n System.out.println(date.toString());\n System.exit(0);\n\
492
+ \ }\n\n\n \n for (i = 0; i < 26; i++)\n { for (j = 0; j < 26; j++)\n\
493
+ \ { for (k = 0; k < 26; k++)\n {\n brutePass = upperCase[i]\
494
+ \ + upperCase[j] + upperCase[k];\n bruteForce1.determinePass(args[0],\
495
+ \ args[1], brutePass);\n if (wrongPass == 'N')\n { i = 26;\n\
496
+ \ j = 26;\n k = 26;\n }}}}\n\n if (wrongPass\
497
+ \ == 'N')\n {\n date.setTime(System.currentTimeMillis());\n System.out.print(\"\
498
+ End time is: \");\n System.out.println(date.toString());\n System.exit(0);\n\
499
+ \ }\n\n \n for (i = 0; i < 26; i++)\n { for (j = 0; j < 26; j++)\n\
500
+ \ { for (k = 0; k < 26; k++)\n {\n brutePass = upperCase[i]\
501
+ \ + upperCase[j] + lowerCase[k];\n bruteForce1.determinePass(args[0],\
502
+ \ args[1], brutePass);\n if (wrongPass == 'N')\n { i = 26;\n\
503
+ \ j = 26;\n k = 26;\n }}}}\n\n if (wrongPass\
504
+ \ == 'N')\n {\n date.setTime(System.currentTimeMillis());\n System.out.print(\"\
505
+ End time is: \");\n System.out.println(date.toString());\n System.exit(0);\n\
506
+ \ }\n\n \n for (i = 0; i < 26; i++)\n { for (j = 0; j < 26; j++)\n\
507
+ \ { for (k = 0; k < 26; k++)\n {\n brutePass = upperCase[i]\
508
+ \ + lowerCase[j] + upperCase[k];\n bruteForce1.determinePass(args[0],\
509
+ \ args[1], brutePass);\n if (wrongPass == 'N')\n { i = 26;\n\
510
+ \ j = 26;\n k = 26;\n }}}}\n\n if (wrongPass\
511
+ \ == 'N')\n {\n date.setTime(System.currentTimeMillis());\n System.out.print(\"\
512
+ End time is: \");\n System.out.println(date.toString());\n System.exit(0);\n\
513
+ \ }\n\n \n for (i = 0; i < 26; i++)\n { for (j = 0; j < 26; j++)\n\
514
+ \ { for (k = 0; k < 26; k++)\n {\n brutePass = upperCase[i]\
515
+ \ + lowerCase[j] + lowerCase[k];\n bruteForce1.determinePass(args[0],\
516
+ \ args[1], brutePass);\n if (wrongPass == 'N')\n { i = 26;\n\
517
+ \ j = 26;\n k = 26;\n }}}}\n\n if (wrongPass\
518
+ \ == 'N')\n {\n date.setTime(System.currentTimeMillis());\n System.out.print(\"\
519
+ End time is: \");\n System.out.println(date.toString());\n System.exit(0);\n\
520
+ \ }\n\n \n for (i = 0; i < 26; i++)\n { for (j = 0; j < 26; j++)\n\
521
+ \ { for (k = 0; k < 26; k++)\n {\n brutePass = lowerCase[i]\
522
+ \ + upperCase[j] + upperCase[k];\n bruteForce1.determinePass(args[0],\
523
+ \ args[1], brutePass);\n if (wrongPass == 'N')\n { i = 26;\n\
524
+ \ j = 26;\n k = 26;\n }}}}\n\n if (wrongPass\
525
+ \ == 'N')\n {\n date.setTime(System.currentTimeMillis());\n System.out.print(\"\
526
+ End time is: \");\n System.out.println(date.toString());\n System.exit(0);\n\
527
+ \ }\n\n \n for (i = 0; i < 26; i++)\n { for (j = 0; j < 26; j++)\n\
528
+ \ { for (k = 0; k < 26; k++)\n {\n brutePass = lowerCase[i]\
529
+ \ + upperCase[j] + lowerCase[k];\n bruteForce1.determinePass(args[0],\
530
+ \ args[1], brutePass);\n if (wrongPass == 'N')\n { i = 26;\n\
531
+ \ j = 26;\n k = 26;\n }}}}\n\n if (wrongPass\
532
+ \ == 'N')\n {\n date.setTime(System.currentTimeMillis());\n System.out.print(\"\
533
+ End time is: \");\n System.out.println(date.toString());\n System.exit(0);\n\
534
+ \ }\n\n \n for (i = 0; i < 26; i++)\n { for (j = 0; j < 26; j++)\n\
535
+ \ { for (k = 0; k < 26; k++)\n {\n brutePass = lowerCase[i]\
536
+ \ + lowerCase[j] + upperCase[k];\n bruteForce1.determinePass(args[0],\
537
+ \ args[1], brutePass);\n if (wrongPass == 'N')\n { i = 26;\n\
538
+ \ j = 26;\n k = 26;\n }}}}\n\n date.setTime(System.currentTimeMillis());\n\
539
+ \ System.out.print(\"End time is: \");\n System.out.println(date.toString());\n\
540
+ \n }\n\n private void getEncoded(String userName, String password){\n userPassword\
541
+ \ = userName + \":\" + password;\n base64_userPassword = new url.misc.BASE64Encoder().encode(userPassword.getBytes());\n\
542
+ \ }\n\n}\n"
543
+ - source_sentence: "\npackage java.httputils;\n\nimport java.io.IOException;\nimport\
544
+ \ java.net.HttpURLConnection;\nimport java.net.MalformedURLException;\nimport\
545
+ \ java.net.URL;\nimport java.sql.Timestamp;\n\n\npublic class BasicAuthHttpRequest\
546
+ \ extends HttpRequestClient\n{\n String userName;\n String password;\n \
547
+ \ \n protected BasicAuthHttpRequest(String url, String userName, String password)\n\
548
+ \ throws MalformedURLException, IOException\n {\n setPassword(password);\n\
549
+ \ setUserName(userName);\n setServerURL(new URL(url));\n \
550
+ \ \n setStart(new Timestamp(System.currentTimeMillis()));\n\n String\
551
+ \ userPassword = userName + \":\" + password;\n\n \n String encoding\
552
+ \ = new url.misc.BASE64Encoder().encode (userPassword.getBytes());\n\n \n\
553
+ \n setHttpConnection(\n (HttpURLConnection)this.getServerURL().openConnection());\n\
554
+ \n \n getHttpConnection().setRequestProperty (\"Authorization\"\
555
+ , \" \" + encoding);\n doRequest();\n }\n\n \n protected BasicAuthHttpRequest(String\
556
+ \ url)\n throws MalformedURLException, IOException\n {\n super(url);\n\
557
+ \ }\n\n \n public BasicAuthHttpRequest()\n {\n super();\n \
558
+ \ }\n\n\n \n public String getPassword()\n {\n return password;\n\
559
+ \ }\n\n \n public String getUserName()\n {\n return userName;\n\
560
+ \ }\n\n \n public void setPassword(String string)\n {\n password\
561
+ \ = string;\n }\n\n \n public void setUserName(String string)\n {\n\
562
+ \ userName = string;\n }\n\n public static void main (String[] args)\n\
563
+ \ {\n BasicAuthHttpRequest client = null;\n try\n {\n\
564
+ \ client = new BasicAuthHttpRequest(args[0], args[1], args[2]);\n \
565
+ \ }\n catch (MalformedURLException e)\n {\n e.printStackTrace();\n\
566
+ \ }\n catch (IOException e)\n {\n e.printStackTrace();\n\
567
+ \ }\n finally\n {\n if (client != null && client.getCode()\
568
+ \ != HttpURLConnection.HTTP_UNAUTHORIZED)\n {\n System.out.println(\n\
569
+ \ \"Request response : \\n\" + client.getCode());\n\n\n \
570
+ \ System.out.println(\n \"Request processing time\
571
+ \ (milliseconds): \" +\n (client.getEnd().getTime() - client.getStart().getTime()));\n\
572
+ \n System.out.println(\n \"Request content:\
573
+ \ \\n\" + client.getContent());\n }\n else\n \
574
+ \ {\n System.out.println(\n \"Request response\
575
+ \ : \\n\" + client.getCode());\n\n\n }\n }\n }\n}\n"
576
+ sentences:
577
+ - "import java.io.*;\nimport java.net.*;\nimport java.security.*;\nimport java.math.*;\n\
578
+ import java.*;\nimport java.util.*;\n\n\npublic class WatchDog\n{\n public\
579
+ \ static FileWriter out = null, output = null;\n\n public static void main\
580
+ \ (String args[]) throws Exception {\n\tSocket socket = null;\n\tDataOutputStream\
581
+ \ = null;\n\tBufferedReader bf = null, fr = null;\n\tString retVal = null, StatusCode\
582
+ \ = \"HTTP/1.1 200 OK\";\n int dirty = 0, count = 0;\n\n stime = System.currentTimeMillis();\n\
583
+ \ System.out.println(\"Detecting the changes...\");\n\n try {\n\n\
584
+ \t \n URL yahoo = new URL(\"http://www.cs.rmit.edu./students/\"\
585
+ );\n URLConnection yc = yahoo.openConnection();\n\n \n \
586
+ \ BufferedReader in = new BufferedReader(\n \
587
+ \ new InputStreamReader(\n yc.getInputStream()));\n\
588
+ \n String inputLine;\n try {\n out = new\
589
+ \ FileWriter(\"newstudent\");\n while ((inputLine = in.readLine())\
590
+ \ != null){\n out.write(inputLine + \"\\n\");\n \
591
+ \ }\n } catch (IOException ex) {\n ex.printStackTrace();\n\
592
+ \ }\n in.print();\n out.print();\n\n \
593
+ \ dirty = diff();\n if (dirty == 1){\n sendMail();\n\
594
+ \ System.out.println(\"Changes detected and email sent!\");\n \
595
+ \ }\n\n if (diffimages() == 1){\n sendMail();\n\
596
+ \ System.out.println(\"Images modification detected and email sent!\"\
597
+ );\n }\n\n updatePage();\n System.out.println(\"\
598
+ ** End of WatchDog checking **\");\n\n } catch (Exception ex) {\n \
599
+ \ ex.printStackTrace();\n }\n }\n\n public static\
600
+ \ int diff()\n {\n int update = 0;\n\n try{\n Process\
601
+ \ process = Runtime.getRuntime().exec(\"diff -b RMITCSStudent newstudent\");\n\
602
+ \ BufferedReader pr = new BufferedReader(\n \
603
+ \ new InputStreamReader(\n process.getInputStream()));\n\
604
+ \n output = new FileWriter(\"output\");\n String inputLine;\n\
605
+ \ while ((inputLine = pr.readLine()) != null){\n output.write(inputLine\
606
+ \ + \"\\n\");\n update = 1;\n }\n output.promt();\n\
607
+ \n }catch (Exception ex){\n ex.printStackTrace();\n }\n\
608
+ \ return update;\n }\n\n public static int diffimages()\n {\n \
609
+ \ int update = 0;\n String image;\n\n try{\n Process\
610
+ \ primages = Runtime.getRuntime().exec(\"./images.sh\");\n wait(1);\n\
611
+ \ File imageFile = new File(\"imagesname\");\n BufferedReader\
612
+ \ fr = new BufferedReader(new FileReader(imageFile));\n\n output = new\
613
+ \ FileWriter(\"output\");\n while ((image = fr.readLine()) != null)\
614
+ \ {\n primages = Runtime.getRuntime().exec(\"diff \" + image +\
615
+ \ \" o\"+image);\n BufferedReader pr = new BufferedReader(\n \
616
+ \ new InputStreamReader(\n \
617
+ \ primages.getInputStream()));\n\n String\
618
+ \ inputLine;\n while ((inputLine = pr.readLine()) != null){\n\
619
+ \ output.write(inputLine + \"\\n\");\n \
620
+ \ update = 1;\n }\n }\n output.print();\n\
621
+ \ fr.close();\n\n }catch (Exception ex){\n ex.printStackTrace();\n\
622
+ \ }\n return update;\n }\n\n public static void sendMail()\n\
623
+ \ {\n try{\n Process mailprocess = Runtime.getRuntime().exec(\"\
624
+ ./email.sh\");\n }catch (Exception ex){\n ex.printStackTrace();\n\
625
+ \ }\n }\n\n public static void updatePage()\n {\n String\
626
+ \ image;\n\n try{\n Process updateprocess = Runtime.getRuntime().exec(\"\
627
+ cp newstudent RMITCSStudent\");\n Process deleteprocess = Runtime.getRuntime().exec(\"\
628
+ rm newstudent\");\n\n File inputFile = new File(\"imagesname\");\n \
629
+ \ BufferedReader fr = new BufferedReader(new FileReader(inputFile));\n\
630
+ \ while ((image = fr.readLine()) != null) {\n updateprocess\
631
+ \ = Runtime.getRuntime().exec(\"cp \" + image + \" o\" + image);\n \
632
+ \ deleteprocess = Runtime.getRuntime().exec(\"rm \" + image);\n \
633
+ \ }\n fr.close();\n }catch (Exception ex){\n ex.printStackTrace();\n\
634
+ \ }\n }\n\n public static void wait(int time){\n\t int timer, times;\n\
635
+ \t timer = System.currentTimeMillis();\n\t times = (time * 1000) + timer;\n\
636
+ \n\t while(timer < times)\n\t\t\ttimer = System.currentTimeMillis();\n\t}\n}"
637
+ - "import java.net.*;\nimport java.io.*;\n\n\npublic class EmailClient\n{\n\tprivate\
638
+ \ String sender, recipient, hostName;\n\n\tpublic EmailClient(String nSender,\
639
+ \ String nRecipient, String nHost)\n\t{\n\t\tsender = nSender;\n\t\trecipient\
640
+ \ = nRecipient;\n\t\thostName = nHost;\n\t}\n\n\tpublic void sendMail(String subject,\
641
+ \ String message)\n\t{\n\t\ttry\n\t\t{\n\t\t\tSocket s1=null;\n\t\t\tInputStream\t\
642
+ is = null;\n\t\t\tOutputStream os = null;\n\n\t\t\tDataOutputStream = null;\n\
643
+ \n\t\t\ts1 = new Socket(hostName,25);\n\t\t\tis = s1.getInputStream();\n\t\t\t\
644
+ os = s1.getOutputStream();\n\n\t\t\tbd = new DataOutputStream(os);\n\n\t\t\tBufferedReader\
645
+ \ response = new BufferedReader(new InputStreamReader(is));\n\n\t\t\tbd.writeBytes(\"\
646
+ HELO \"+ InetAddress.getLocalHost().getHostName() + \"\\r\\n\");\n\n\t\t\twaitForSuccessResponse(response);\n\
647
+ \n\t\t\tbd.writeBytes(\"MAIL FROM:\"+sender+\"\\n\");\n\n\t\t\twaitForSuccessResponse(response);\n\
648
+ \n\t\t\tbd.writeBytes(\"RCPT :\"+recipient+\"\\n\");\n\n\t\t\twaitForSuccessResponse(response);\n\
649
+ \n\t\t\tbd.writeBytes(\"data\"+\"\\n\");\n\n\t\t\tbd.writeBytes(\"Subject:\"+subject+\"\
650
+ \\n\");\n\n\t\t\tbd.writeBytes(message+\"\\n.\\n\");\n\n\t\t\twaitForSuccessResponse(response);\n\
651
+ \t\t}\n\n\t\tcatch (UnknownHostException badUrl)\n\t\t{\n\t\t\tSystem.out.println(\"\
652
+ Host unknown.\");\n\t\t}\n\n\t\tcatch (EOFException eof)\n\t\t{\n\t\t\tSystem.out.println(\"\
653
+ <EOF>\");\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"\
654
+ got exception: \"+e);\n\t\t}\n\t}\n\n\tprivate static void\twaitForSuccessResponse(BufferedReader\
655
+ \ response) throws IOException\n\t{\n\t\tString rsp;\n\t\tboolean r250 = false;\n\
656
+ \n\t\twhile( ! r250 )\n\t\t{\n\t\t\trsp = response.readLine().trim();\n\n\t\t\t\
657
+ if(rsp.startsWith(\"250\"))\n\t\t\t\tr250 = true;\n\t\t}\n\n\t}\n}"
658
+ - "\n\nimport java.io.*;\nimport java.*;\nimport java.net.*;\nimport java.util.*;\n\
659
+ \npublic class WatchDog {\n public static void main (String[] args) throws IOException\
660
+ \ {\n BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));\n\
661
+ \ try{\n twentyfourhours = 86400000;\n Timer timer = new Timer();\n \
662
+ \ final Runtime rt = Runtime.getRuntime();\n\n try{\n Process wg1 = rt.exec(\"\
663
+ ./.sh\");\n wg1.waitFor();\n }\n catch(InterruptedException e ){\n \
664
+ \ System.err.println();\n e.printStackTrace();\n }\n\n class RepeatTask\
665
+ \ extends TimerTask{\n public void run(){\n try{\n Process wg2\
666
+ \ = rt.exec(\"./task.sh\");\n wg2.waitFor();\n FileReader fr = new\
667
+ \ FileReader(\"check.txt\");\n BufferedReader bufr = new BufferedReader(fr);\n\
668
+ \ String check = bufr.readLine();\n if(check.equals(\".txt: FAILED\"\
669
+ )) {\n Process difftosend = rt.exec(\"./diff.sh\");\n difftosend.waitFor();\n\
670
+ \ Process reset = rt.exec(\"./.sh\");\n reset.waitFor();\n \
671
+ \ }\n FileReader fr2 = new FileReader(\"imgdiffs.txt\");\n BufferedReader\
672
+ \ bufr2 = new BufferedReader(fr2);\n String imdiff = bufr2.readLine();\n\
673
+ \ if(imdiff != null){\n Process imdifftosend = rt.exec(\"./img.sh\"\
674
+ );\n imdifftosend.waitFor();\n Process reset = rt.exec(\"./.sh\"\
675
+ );\n reset.waitFor();\n }\n }\n catch(InterruptedException\
676
+ \ e){System.err.println();e.printStackTrace();}\n catch(IOException e){\n\
677
+ \ System.err.println(e);\n e.printStackTrace();\n }\n }}\n\
678
+ \n timer.scheduleAtFixedRate(new RepeatTask(),twentyfourhours,twentyfourhours);\n\
679
+ \ \n }\n catch(IOException e){\n System.err.println(e);\n e.printStackTrace();\n\
680
+ \ }\n \n}}\n"
681
+ pipeline_tag: sentence-similarity
682
+ library_name: sentence-transformers
683
+ ---
684
+
685
+ # SentenceTransformer based on huggingface/CodeBERTa-small-v1
686
+
687
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [huggingface/CodeBERTa-small-v1](https://huggingface.co/huggingface/CodeBERTa-small-v1). 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.
688
+
689
+ ## Model Details
690
+
691
+ ### Model Description
692
+ - **Model Type:** Sentence Transformer
693
+ - **Base model:** [huggingface/CodeBERTa-small-v1](https://huggingface.co/huggingface/CodeBERTa-small-v1) <!-- at revision e93b5898cff07f03f1c1c09cde284d1b85962363 -->
694
+ - **Maximum Sequence Length:** 512 tokens
695
+ - **Output Dimensionality:** 768 dimensions
696
+ - **Similarity Function:** Cosine Similarity
697
+ <!-- - **Training Dataset:** Unknown -->
698
+ <!-- - **Language:** Unknown -->
699
+ <!-- - **License:** Unknown -->
700
+
701
+ ### Model Sources
702
+
703
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
704
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
705
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
706
+
707
+ ### Full Model Architecture
708
+
709
+ ```
710
+ SentenceTransformer(
711
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: RobertaModel
712
+ (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})
713
+ )
714
+ ```
715
+
716
+ ## Usage
717
+
718
+ ### Direct Usage (Sentence Transformers)
719
+
720
+ First install the Sentence Transformers library:
721
+
722
+ ```bash
723
+ pip install -U sentence-transformers
724
+ ```
725
+
726
+ Then you can load this model and run inference.
727
+ ```python
728
+ from sentence_transformers import SentenceTransformer
729
+
730
+ # Download from the 🤗 Hub
731
+ model = SentenceTransformer("buelfhood/SOCO-Java-CodeBERTa-ST-1")
732
+ # Run inference
733
+ sentences = [
734
+ '\npackage java.httputils;\n\nimport java.io.IOException;\nimport java.net.HttpURLConnection;\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.sql.Timestamp;\n\n\npublic class BasicAuthHttpRequest extends HttpRequestClient\n{\n String userName;\n String password;\n \n protected BasicAuthHttpRequest(String url, String userName, String password)\n throws MalformedURLException, IOException\n {\n setPassword(password);\n setUserName(userName);\n setServerURL(new URL(url));\n \n setStart(new Timestamp(System.currentTimeMillis()));\n\n String userPassword = userName + ":" + password;\n\n \n String encoding = new url.misc.BASE64Encoder().encode (userPassword.getBytes());\n\n \n\n setHttpConnection(\n (HttpURLConnection)this.getServerURL().openConnection());\n\n \n getHttpConnection().setRequestProperty ("Authorization", " " + encoding);\n doRequest();\n }\n\n \n protected BasicAuthHttpRequest(String url)\n throws MalformedURLException, IOException\n {\n super(url);\n }\n\n \n public BasicAuthHttpRequest()\n {\n super();\n }\n\n\n \n public String getPassword()\n {\n return password;\n }\n\n \n public String getUserName()\n {\n return userName;\n }\n\n \n public void setPassword(String string)\n {\n password = string;\n }\n\n \n public void setUserName(String string)\n {\n userName = string;\n }\n\n public static void main (String[] args)\n {\n BasicAuthHttpRequest client = null;\n try\n {\n client = new BasicAuthHttpRequest(args[0], args[1], args[2]);\n }\n catch (MalformedURLException e)\n {\n e.printStackTrace();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n if (client != null && client.getCode() != HttpURLConnection.HTTP_UNAUTHORIZED)\n {\n System.out.println(\n "Request response : \\n" + client.getCode());\n\n\n System.out.println(\n "Request processing time (milliseconds): " +\n (client.getEnd().getTime() - client.getStart().getTime()));\n\n System.out.println(\n "Request content: \\n" + client.getContent());\n }\n else\n {\n System.out.println(\n "Request response : \\n" + client.getCode());\n\n\n }\n }\n }\n}\n',
735
+ 'import java.io.*;\nimport java.net.*;\nimport java.security.*;\nimport java.math.*;\nimport java.*;\nimport java.util.*;\n\n\npublic class WatchDog\n{\n public static FileWriter out = null, output = null;\n\n public static void main (String args[]) throws Exception {\n\tSocket socket = null;\n\tDataOutputStream = null;\n\tBufferedReader bf = null, fr = null;\n\tString retVal = null, StatusCode = "HTTP/1.1 200 OK";\n int dirty = 0, count = 0;\n\n stime = System.currentTimeMillis();\n System.out.println("Detecting the changes...");\n\n try {\n\n\t \n URL yahoo = new URL("http://www.cs.rmit.edu./students/");\n URLConnection yc = yahoo.openConnection();\n\n \n BufferedReader in = new BufferedReader(\n new InputStreamReader(\n yc.getInputStream()));\n\n String inputLine;\n try {\n out = new FileWriter("newstudent");\n while ((inputLine = in.readLine()) != null){\n out.write(inputLine + "\\n");\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n in.print();\n out.print();\n\n dirty = diff();\n if (dirty == 1){\n sendMail();\n System.out.println("Changes detected and email sent!");\n }\n\n if (diffimages() == 1){\n sendMail();\n System.out.println("Images modification detected and email sent!");\n }\n\n updatePage();\n System.out.println("** End of WatchDog checking **");\n\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }\n\n public static int diff()\n {\n int update = 0;\n\n try{\n Process process = Runtime.getRuntime().exec("diff -b RMITCSStudent newstudent");\n BufferedReader pr = new BufferedReader(\n new InputStreamReader(\n process.getInputStream()));\n\n output = new FileWriter("output");\n String inputLine;\n while ((inputLine = pr.readLine()) != null){\n output.write(inputLine + "\\n");\n update = 1;\n }\n output.promt();\n\n }catch (Exception ex){\n ex.printStackTrace();\n }\n return update;\n }\n\n public static int diffimages()\n {\n int update = 0;\n String image;\n\n try{\n Process primages = Runtime.getRuntime().exec("./images.sh");\n wait(1);\n File imageFile = new File("imagesname");\n BufferedReader fr = new BufferedReader(new FileReader(imageFile));\n\n output = new FileWriter("output");\n while ((image = fr.readLine()) != null) {\n primages = Runtime.getRuntime().exec("diff " + image + " o"+image);\n BufferedReader pr = new BufferedReader(\n new InputStreamReader(\n primages.getInputStream()));\n\n String inputLine;\n while ((inputLine = pr.readLine()) != null){\n output.write(inputLine + "\\n");\n update = 1;\n }\n }\n output.print();\n fr.close();\n\n }catch (Exception ex){\n ex.printStackTrace();\n }\n return update;\n }\n\n public static void sendMail()\n {\n try{\n Process mailprocess = Runtime.getRuntime().exec("./email.sh");\n }catch (Exception ex){\n ex.printStackTrace();\n }\n }\n\n public static void updatePage()\n {\n String image;\n\n try{\n Process updateprocess = Runtime.getRuntime().exec("cp newstudent RMITCSStudent");\n Process deleteprocess = Runtime.getRuntime().exec("rm newstudent");\n\n File inputFile = new File("imagesname");\n BufferedReader fr = new BufferedReader(new FileReader(inputFile));\n while ((image = fr.readLine()) != null) {\n updateprocess = Runtime.getRuntime().exec("cp " + image + " o" + image);\n deleteprocess = Runtime.getRuntime().exec("rm " + image);\n }\n fr.close();\n }catch (Exception ex){\n ex.printStackTrace();\n }\n }\n\n public static void wait(int time){\n\t int timer, times;\n\t timer = System.currentTimeMillis();\n\t times = (time * 1000) + timer;\n\n\t while(timer < times)\n\t\t\ttimer = System.currentTimeMillis();\n\t}\n}',
736
+ 'import java.net.*;\nimport java.io.*;\n\n\npublic class EmailClient\n{\n\tprivate String sender, recipient, hostName;\n\n\tpublic EmailClient(String nSender, String nRecipient, String nHost)\n\t{\n\t\tsender = nSender;\n\t\trecipient = nRecipient;\n\t\thostName = nHost;\n\t}\n\n\tpublic void sendMail(String subject, String message)\n\t{\n\t\ttry\n\t\t{\n\t\t\tSocket s1=null;\n\t\t\tInputStream\tis = null;\n\t\t\tOutputStream os = null;\n\n\t\t\tDataOutputStream = null;\n\n\t\t\ts1 = new Socket(hostName,25);\n\t\t\tis = s1.getInputStream();\n\t\t\tos = s1.getOutputStream();\n\n\t\t\tbd = new DataOutputStream(os);\n\n\t\t\tBufferedReader response = new BufferedReader(new InputStreamReader(is));\n\n\t\t\tbd.writeBytes("HELO "+ InetAddress.getLocalHost().getHostName() + "\\r\\n");\n\n\t\t\twaitForSuccessResponse(response);\n\n\t\t\tbd.writeBytes("MAIL FROM:"+sender+"\\n");\n\n\t\t\twaitForSuccessResponse(response);\n\n\t\t\tbd.writeBytes("RCPT :"+recipient+"\\n");\n\n\t\t\twaitForSuccessResponse(response);\n\n\t\t\tbd.writeBytes("data"+"\\n");\n\n\t\t\tbd.writeBytes("Subject:"+subject+"\\n");\n\n\t\t\tbd.writeBytes(message+"\\n.\\n");\n\n\t\t\twaitForSuccessResponse(response);\n\t\t}\n\n\t\tcatch (UnknownHostException badUrl)\n\t\t{\n\t\t\tSystem.out.println("Host unknown.");\n\t\t}\n\n\t\tcatch (EOFException eof)\n\t\t{\n\t\t\tSystem.out.println("<EOF>");\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println("got exception: "+e);\n\t\t}\n\t}\n\n\tprivate static void\twaitForSuccessResponse(BufferedReader response) throws IOException\n\t{\n\t\tString rsp;\n\t\tboolean r250 = false;\n\n\t\twhile( ! r250 )\n\t\t{\n\t\t\trsp = response.readLine().trim();\n\n\t\t\tif(rsp.startsWith("250"))\n\t\t\t\tr250 = true;\n\t\t}\n\n\t}\n}',
737
+ ]
738
+ embeddings = model.encode(sentences)
739
+ print(embeddings.shape)
740
+ # [3, 768]
741
+
742
+ # Get the similarity scores for the embeddings
743
+ similarities = model.similarity(embeddings, embeddings)
744
+ print(similarities.shape)
745
+ # [3, 3]
746
+ ```
747
+
748
+ <!--
749
+ ### Direct Usage (Transformers)
750
+
751
+ <details><summary>Click to see the direct usage in Transformers</summary>
752
+
753
+ </details>
754
+ -->
755
+
756
+ <!--
757
+ ### Downstream Usage (Sentence Transformers)
758
+
759
+ You can finetune this model on your own dataset.
760
+
761
+ <details><summary>Click to expand</summary>
762
+
763
+ </details>
764
+ -->
765
+
766
+ <!--
767
+ ### Out-of-Scope Use
768
+
769
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
770
+ -->
771
+
772
+ <!--
773
+ ## Bias, Risks and Limitations
774
+
775
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
776
+ -->
777
+
778
+ <!--
779
+ ### Recommendations
780
+
781
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
782
+ -->
783
+
784
+ ## Training Details
785
+
786
+ ### Training Dataset
787
+
788
+ #### Unnamed Dataset
789
+
790
+ * Size: 33,411 training samples
791
+ * Columns: <code>sentence_0</code>, <code>sentence_1</code>, and <code>label</code>
792
+ * Approximate statistics based on the first 1000 samples:
793
+ | | sentence_0 | sentence_1 | label |
794
+ |:--------|:-------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:-----------------------------------------------|
795
+ | type | string | string | int |
796
+ | details | <ul><li>min: 51 tokens</li><li>mean: 444.12 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>min: 54 tokens</li><li>mean: 462.06 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>0: ~99.80%</li><li>1: ~0.20%</li></ul> |
797
+ * Samples:
798
+ | sentence_0 | sentence_1 | label |
799
+ |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------|
800
+ | <code><br><br><br>import java.net.*;<br>import java.io.*;<br>import java.Runtime;<br><br>public class WatchDog{<br> public WatchDog(){}<br><br><br> public void copyTo(){<br><br> }<br><br> public static void main(String[] args) throws Exception {<br> WatchDog wd= new WatchDog();<br> SendEMail t = new SendEMail();<br> PrintWriter pw=null;<br> URL url = new URL("http://www.cs.rmit.edu./students");<br> URLConnection yc = url.openConnection();<br> System.out.println("Connection opened...");<br> BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));<br> String inputLine;<br> try{<br> pw=new PrintWriter(new FileOutputStream("newHtml"));<br> while ((inputLine = in.readLine()) != null){<br> <br> pw.println(inputLine);<br> }<br> pw.save();<br> }catch(IOException e){<br> System.out.println("Error saving the file");<br> }<br><br> <br> Process p = Runtime.getRuntime().exec("diff -b newHtml oldHtml"); <br> ...</code> | <code><br><br><br><br>import java.io.*;<br>import java.net.*;<br>import java.*;<br>import java.util.*;<br><br>public class DictionaryAttack<br>{<br> public static void main ( String args[])<br> {<br> <br> String function,pass,temp1;<br> int count =0;<br> <br> try{<br> <br> FileReader fr = new FileReader("words.txt");<br> BufferedReader bfread = new BufferedReader(fr);<br><br> Runtime rtime = Runtime.getRuntime();<br> Process prs = null; <br><br><br> while(( bf = bfread.readLine()) != null)<br> {<br> <br> <br> if( f.length() < 4 )<br> {<br> System.out.println(+ " The Attack Number =====>" + count++ );<br> pass = f;<br> <br> function ="wget --http-user= --http-passwd="+pass+" http://sec-crack.cs.rmit.edu./SEC/2/";<br> prs = rtime.exec(function);<br> <br> InputStreamReader stre = new InputStreamReader(prs.getErrorStream());<br> BufferedReader bread = new BufferedReader(stre);<br> while( (temp1 = bread.readLine())!= null)<br> {<br> System.out.println(temp1);<br> if(temp1.equals("HTTP request sent, awaiting resp...</code> | <code>0</code> |
801
+ | <code><br><br><br><br>import java.net.*;<br>import java.io.*;<br>import java.util.*;<br><br>public class WatchDog<br>{<br><br> public WatchDog()<br> {<br> }<br><br> public static void main(String[] args)<br> {<br> try<br> {<br> if( args.length != 2 )<br> {<br> System.out.println("USAGE: java WatchDog <URL> <mailing UserName>");<br> System.exit(0);<br> }<br><br> Runtime.getRuntime().exec("rm LastWatch.html");<br> Runtime.getRuntime().exec("rm WatchDog.ini");<br><br> Thread.sleep(1000);<br><br> while (true)<br> {<br> WatchDog myWatchDog = new WatchDog();<br> myWatchDog.readHTML(args[0], args[1]);<br><br> Runtime.getRuntime().exec("rm Report.txt");<br> Runtime.getRuntime().exec("rm diffReport.txt");<br> Runtime.getRuntime().exec("rm NewWatch.txt");<br><br> System.out.println(" check after 2 ... press Ctrl-Z suspend WatchDog...");<br><br> Thread.sleep(2*60*1000); <br><br><br> }<br> ...</code> | <code><br><br>import java.net.*;<br>import java.io.*;<br> <br><br>class MyAuthenticator extends Authenticator {<br><br> String password;<br><br> public MyAuthenticator(String pwdin) {<br> password = pwdin;<br> }<br> <br> protected PasswordAuthentication getPasswordAuthentication(){<br> String pwd = password;<br> return new PasswordAuthentication("",pwd.toCharArray());<br> }<br>}<br></code> | <code>0</code> |
802
+ | <code><br><br>import java.Runtime;<br>import java.io.*;<br><br>public class differenceFile<br>{<br> StringWriter sw =null;<br> PrintWriter pw = null;<br> public differenceFile()<br> {<br> sw = new StringWriter();<br> pw = new PrintWriter();<br> }<br> public String compareFile()<br> {<br> try<br> {<br> Process = Runtime.getRuntime().exec("diff History.txt Comparison.txt");<br><br> InputStream write = sw.getInputStream();<br> BufferedReader bf = new BufferedReader (new InputStreamReader(write));<br> String line;<br> while((line = bf.readLine())!=null)<br> pw.println(line);<br> if((sw.toString().trim()).equals(""))<br> {<br> System.out.println(" difference");<br> return null;<br> }<br> System.out.println(sw.toString().trim());<br> }catch(Exception e){}<br> return sw.toString().trim();<br> }<br>}</code> | <code><br><br><br><br>public class HoldSharedData<br>{<br> private int numOfConnections = 0;<br> private int startTime;<br> private int totalTime = 0;<br> private String[] password;<br> private int pwdCount;<br><br> public HoldSharedData( int time, String[] pwd, int count )<br> {<br> startTime = time;<br><br> password = pwd;<br> pwdCount = count;<br> }<br><br> public int getPwdCount()<br> {<br> return pwdCount;<br> }<br><br> public void setNumOfConnections( )<br> {<br> numOfConnections ++;<br> }<br><br> public int getNumOfConnections()<br> {<br> return numOfConnections;<br> }<br><br> public int getStartTime()<br> {<br> return startTime;<br> }<br><br> public void setTotalTime( int newTotalTime )<br> {<br> totalTime = newTotalTime;<br> }<br><br> public int getTotalTime()<br> {<br> return totalTime;<br> }<br><br> public String getPasswordAt( int index )<br> {<br> return password[index];<br> }<br>} <br></code> | <code>0</code> |
803
+ * Loss: [<code>BatchAllTripletLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#batchalltripletloss)
804
+
805
+ ### Training Hyperparameters
806
+ #### Non-Default Hyperparameters
807
+
808
+ - `per_device_train_batch_size`: 16
809
+ - `per_device_eval_batch_size`: 16
810
+ - `num_train_epochs`: 1
811
+ - `fp16`: True
812
+ - `multi_dataset_batch_sampler`: round_robin
813
+
814
+ #### All Hyperparameters
815
+ <details><summary>Click to expand</summary>
816
+
817
+ - `overwrite_output_dir`: False
818
+ - `do_predict`: False
819
+ - `eval_strategy`: no
820
+ - `prediction_loss_only`: True
821
+ - `per_device_train_batch_size`: 16
822
+ - `per_device_eval_batch_size`: 16
823
+ - `per_gpu_train_batch_size`: None
824
+ - `per_gpu_eval_batch_size`: None
825
+ - `gradient_accumulation_steps`: 1
826
+ - `eval_accumulation_steps`: None
827
+ - `torch_empty_cache_steps`: None
828
+ - `learning_rate`: 5e-05
829
+ - `weight_decay`: 0.0
830
+ - `adam_beta1`: 0.9
831
+ - `adam_beta2`: 0.999
832
+ - `adam_epsilon`: 1e-08
833
+ - `max_grad_norm`: 1
834
+ - `num_train_epochs`: 1
835
+ - `max_steps`: -1
836
+ - `lr_scheduler_type`: linear
837
+ - `lr_scheduler_kwargs`: {}
838
+ - `warmup_ratio`: 0.0
839
+ - `warmup_steps`: 0
840
+ - `log_level`: passive
841
+ - `log_level_replica`: warning
842
+ - `log_on_each_node`: True
843
+ - `logging_nan_inf_filter`: True
844
+ - `save_safetensors`: True
845
+ - `save_on_each_node`: False
846
+ - `save_only_model`: False
847
+ - `restore_callback_states_from_checkpoint`: False
848
+ - `no_cuda`: False
849
+ - `use_cpu`: False
850
+ - `use_mps_device`: False
851
+ - `seed`: 42
852
+ - `data_seed`: None
853
+ - `jit_mode_eval`: False
854
+ - `use_ipex`: False
855
+ - `bf16`: False
856
+ - `fp16`: True
857
+ - `fp16_opt_level`: O1
858
+ - `half_precision_backend`: auto
859
+ - `bf16_full_eval`: False
860
+ - `fp16_full_eval`: False
861
+ - `tf32`: None
862
+ - `local_rank`: 0
863
+ - `ddp_backend`: None
864
+ - `tpu_num_cores`: None
865
+ - `tpu_metrics_debug`: False
866
+ - `debug`: []
867
+ - `dataloader_drop_last`: False
868
+ - `dataloader_num_workers`: 0
869
+ - `dataloader_prefetch_factor`: None
870
+ - `past_index`: -1
871
+ - `disable_tqdm`: False
872
+ - `remove_unused_columns`: True
873
+ - `label_names`: None
874
+ - `load_best_model_at_end`: False
875
+ - `ignore_data_skip`: False
876
+ - `fsdp`: []
877
+ - `fsdp_min_num_params`: 0
878
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
879
+ - `fsdp_transformer_layer_cls_to_wrap`: None
880
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
881
+ - `deepspeed`: None
882
+ - `label_smoothing_factor`: 0.0
883
+ - `optim`: adamw_torch
884
+ - `optim_args`: None
885
+ - `adafactor`: False
886
+ - `group_by_length`: False
887
+ - `length_column_name`: length
888
+ - `ddp_find_unused_parameters`: None
889
+ - `ddp_bucket_cap_mb`: None
890
+ - `ddp_broadcast_buffers`: False
891
+ - `dataloader_pin_memory`: True
892
+ - `dataloader_persistent_workers`: False
893
+ - `skip_memory_metrics`: True
894
+ - `use_legacy_prediction_loop`: False
895
+ - `push_to_hub`: False
896
+ - `resume_from_checkpoint`: None
897
+ - `hub_model_id`: None
898
+ - `hub_strategy`: every_save
899
+ - `hub_private_repo`: None
900
+ - `hub_always_push`: False
901
+ - `gradient_checkpointing`: False
902
+ - `gradient_checkpointing_kwargs`: None
903
+ - `include_inputs_for_metrics`: False
904
+ - `include_for_metrics`: []
905
+ - `eval_do_concat_batches`: True
906
+ - `fp16_backend`: auto
907
+ - `push_to_hub_model_id`: None
908
+ - `push_to_hub_organization`: None
909
+ - `mp_parameters`:
910
+ - `auto_find_batch_size`: False
911
+ - `full_determinism`: False
912
+ - `torchdynamo`: None
913
+ - `ray_scope`: last
914
+ - `ddp_timeout`: 1800
915
+ - `torch_compile`: False
916
+ - `torch_compile_backend`: None
917
+ - `torch_compile_mode`: None
918
+ - `include_tokens_per_second`: False
919
+ - `include_num_input_tokens_seen`: False
920
+ - `neftune_noise_alpha`: None
921
+ - `optim_target_modules`: None
922
+ - `batch_eval_metrics`: False
923
+ - `eval_on_start`: False
924
+ - `use_liger_kernel`: False
925
+ - `eval_use_gather_object`: False
926
+ - `average_tokens_across_devices`: False
927
+ - `prompts`: None
928
+ - `batch_sampler`: batch_sampler
929
+ - `multi_dataset_batch_sampler`: round_robin
930
+
931
+ </details>
932
+
933
+ ### Training Logs
934
+ | Epoch | Step | Training Loss |
935
+ |:------:|:----:|:-------------:|
936
+ | 0.2393 | 500 | 0.2031 |
937
+ | 0.4787 | 1000 | 0.1761 |
938
+ | 0.7180 | 1500 | 0.1914 |
939
+ | 0.9574 | 2000 | 0.2044 |
940
+
941
+
942
+ ### Framework Versions
943
+ - Python: 3.11.13
944
+ - Sentence Transformers: 4.1.0
945
+ - Transformers: 4.52.4
946
+ - PyTorch: 2.6.0+cu124
947
+ - Accelerate: 1.7.0
948
+ - Datasets: 3.6.0
949
+ - Tokenizers: 0.21.1
950
+
951
+ ## Citation
952
+
953
+ ### BibTeX
954
+
955
+ #### Sentence Transformers
956
+ ```bibtex
957
+ @inproceedings{reimers-2019-sentence-bert,
958
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
959
+ author = "Reimers, Nils and Gurevych, Iryna",
960
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
961
+ month = "11",
962
+ year = "2019",
963
+ publisher = "Association for Computational Linguistics",
964
+ url = "https://arxiv.org/abs/1908.10084",
965
+ }
966
+ ```
967
+
968
+ #### BatchAllTripletLoss
969
+ ```bibtex
970
+ @misc{hermans2017defense,
971
+ title={In Defense of the Triplet Loss for Person Re-Identification},
972
+ author={Alexander Hermans and Lucas Beyer and Bastian Leibe},
973
+ year={2017},
974
+ eprint={1703.07737},
975
+ archivePrefix={arXiv},
976
+ primaryClass={cs.CV}
977
+ }
978
+ ```
979
+
980
+ <!--
981
+ ## Glossary
982
+
983
+ *Clearly define terms in order to be accessible across audiences.*
984
+ -->
985
+
986
+ <!--
987
+ ## Model Card Authors
988
+
989
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
990
+ -->
991
+
992
+ <!--
993
+ ## Model Card Contact
994
+
995
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
996
+ -->
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "RobertaModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "classifier_dropout": null,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 1e-05,
15
+ "max_position_embeddings": 514,
16
+ "model_type": "roberta",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 6,
19
+ "pad_token_id": 1,
20
+ "position_embedding_type": "absolute",
21
+ "torch_dtype": "float32",
22
+ "transformers_version": "4.52.4",
23
+ "type_vocab_size": 1,
24
+ "use_cache": true,
25
+ "vocab_size": 52000
26
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "4.1.0",
4
+ "transformers": "4.52.4",
5
+ "pytorch": "2.6.0+cu124"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8cb322e66a2726d483dca5f0608a912dbc374db3311463079b9ed4664533f372
3
+ size 333815048
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ }
14
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": true,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": true,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": true,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<s>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<pad>",
14
+ "lstrip": false,
15
+ "normalized": true,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "</s>",
22
+ "lstrip": false,
23
+ "normalized": true,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": true,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "4": {
37
+ "content": "<mask>",
38
+ "lstrip": true,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ }
44
+ },
45
+ "bos_token": "<s>",
46
+ "clean_up_tokenization_spaces": false,
47
+ "cls_token": "<s>",
48
+ "eos_token": "</s>",
49
+ "errors": "replace",
50
+ "extra_special_tokens": {},
51
+ "mask_token": "<mask>",
52
+ "max_len": 512,
53
+ "model_max_length": 512,
54
+ "pad_token": "<pad>",
55
+ "sep_token": "</s>",
56
+ "tokenizer_class": "RobertaTokenizer",
57
+ "trim_offsets": true,
58
+ "unk_token": "<unk>"
59
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff