Skip to content

Commit

Permalink
Merge pull request #30 from mhijazi1/Mo
Browse files Browse the repository at this point in the history
Mo
  • Loading branch information
Mo committed Oct 25, 2015
2 parents 5e77e9b + f85c9f6 commit c6408c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions UGAHacksProject/src/main/java/gsu/ugahacksproject/tagg.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public String predict(String filePath){
BufferedReader error = new BufferedReader(new InputStreamReader(p.getErrorStream()));
String line = null;
while ((line = error.readLine()) != null) {
System.out.println("Python says: " + line);
System.out.println("Python error: " + line);
}

BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
Expand Down Expand Up @@ -67,22 +67,22 @@ public void trainNew(String filePath, String result){
BufferedReader error = new BufferedReader(new InputStreamReader(p.getErrorStream()));
String line = null;
while ((line = error.readLine()) != null) {
System.out.println("Python says: " + line);
System.out.println("Python error: " + line);
}
int exitVal = p.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
public void dispute(String filePath, String expectedResult, String actualResult){
public void dispute(String filePath, String actualResult, String expectedResult){
try {
// System.out.println(fileContent);
// Runtime rt = Runtime.getRuntime();
Process p = Runtime.getRuntime().exec("python " + commandPath + "/trainNew.py " + filePath + " " + expectedResult + " bad " + actualResult);
Process p = Runtime.getRuntime().exec("python " + commandPath + "/trainNew.py " + filePath + " " + actualResult + " bad " + expectedResult);
BufferedReader error = new BufferedReader(new InputStreamReader(p.getErrorStream()));
String line = null;
while ((line = error.readLine()) != null) {
System.out.println("Python says: " + line);
System.out.println("Python error: " + line);
}
int exitVal = p.waitFor();
} catch (Exception e) {
Expand Down
6 changes: 3 additions & 3 deletions UGAHacksProject/src/main/resources/python/trainNew.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
"Qu6z2uKlfDgqa7Atn1HlOBa3pakRBQHflQicLNr_",
"8WgQ8D4Dp9IW1JilxEfjXjgg1geq1zpaeT3P7Rk3")

possibleStates["dent", "perfect"]
possibleStates=["dent", "perfect"]
url = sys.argv[1]
state = sys.argv[2].lower
predictResult = sys.argv[3].lower()

if predictResult == "good":
clarifai_api.positive(url, state)
for s in states:
for s in possibleStates:
if s != state:
clarifai_api.negative(url, s)
clarifai_api.train(state)
if predictResult == "bad":
expectedState = sys.argv[4].lower()
clarifai_api.positive(url, expectedState)
for s in states:
for s in possibleStates:
if s != expectedState:
clarifai_api.negative(url, s)
clarifai_api.train(expectedState)
Expand Down

0 comments on commit c6408c2

Please sign in to comment.