query eval scaffolding
All checks were successful
studiorailgun/trpg/pipeline/head This commit looks good
All checks were successful
studiorailgun/trpg/pipeline/head This commit looks good
This commit is contained in:
parent
67360681c9
commit
a48c21f1f5
@ -8,6 +8,8 @@ sitting in a tavern by a fireplace
|
||||
|
||||
|
||||
Respond to "What color is your hat?"
|
||||
- determine sentence function
|
||||
- determine what is being queried for
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
▄╘з▓┌кЪДЖЬ▄йЩ▄сЩлЖ╔в╔▓ИКЙG ▄шЁЗаБ÷Т╒(▀лЙ▀Рэ║Р
2
|
||||
╪МёКУ╘ТВэТН▒║Х∙╫√=╔в╔▓ИКЙG ▄шЁЗаБ÷Т╒(фБЕ╨≥┘юШ2
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,5 @@
|
||||
"utility","transfer","query","imperative","sentence"
|
||||
1,0,0,0,"Hello"
|
||||
1,0,0,0,"Hi"
|
||||
1,0,0,0,"Howdy"
|
||||
1,0,0,0,"Howdy"
|
||||
0,0,1,0,"What color is your hat?"
|
||||
|
@ -1,4 +1,5 @@
|
||||
"utility","transfer","query","imperative","sentence"
|
||||
1,0,0,0,"Hello"
|
||||
1,0,0,0,"Hi"
|
||||
1,0,0,0,"Howdy"
|
||||
1,0,0,0,"Howdy"
|
||||
0,0,1,0,"What color is your hat?"
|
||||
|
@ -27,6 +27,8 @@ public class AgentLoop {
|
||||
try (Scanner scan = new Scanner(System.in)) {
|
||||
String prompt = "";
|
||||
|
||||
System.out.println("Agent is ready..");
|
||||
|
||||
//actual main loop
|
||||
while(running){
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package org.studiorailgun.conversation.evaluators;
|
||||
import org.studiorailgun.conversation.categorization.SentenceFunctionCategorizor;
|
||||
import org.studiorailgun.conversation.evaluators.goal.GoalEval;
|
||||
import org.studiorailgun.conversation.evaluators.greet.GreetingEval;
|
||||
import org.studiorailgun.conversation.evaluators.query.QueryEval;
|
||||
import org.studiorailgun.conversation.evaluators.synthesis.ResponseEval;
|
||||
import org.studiorailgun.conversation.tracking.Conversation;
|
||||
import org.studiorailgun.conversation.tracking.Quote;
|
||||
@ -25,9 +26,12 @@ public class EvaluationTree {
|
||||
case UTILITY: {
|
||||
GreetingEval.evaluate(conversation, quote);
|
||||
} break;
|
||||
default: {
|
||||
|
||||
case QUERY: {
|
||||
QueryEval.evaluate(conversation, quote);
|
||||
} break;
|
||||
default: {
|
||||
throw new UnsupportedOperationException("Unsupported quote function: " + quote.getFunction());
|
||||
}
|
||||
}
|
||||
|
||||
//evaluate the AI's current goal in the conversation
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package org.studiorailgun.conversation.evaluators.query;
|
||||
|
||||
import org.studiorailgun.conversation.tracking.Conversation;
|
||||
import org.studiorailgun.conversation.tracking.Quote;
|
||||
|
||||
/**
|
||||
* Evaluates queries
|
||||
*/
|
||||
public class QueryEval {
|
||||
|
||||
/**
|
||||
* Evaluates a quote
|
||||
* @param conversation The conversation
|
||||
* @param quote The quote
|
||||
*/
|
||||
public static void evaluate(Conversation conversation, Quote quote){
|
||||
System.out.println("Is a query!");
|
||||
}
|
||||
|
||||
}
|
||||
@ -19,7 +19,11 @@ public class ResponseEval {
|
||||
switch(conversation.getGoalData().getGoal()){
|
||||
case GREET: {
|
||||
response = GreetingEval.constructGreeting(conversation);
|
||||
conversation.getGreetingData().getHaveGreeted().add(conversation.getSelf());
|
||||
} break;
|
||||
default: {
|
||||
throw new UnsupportedOperationException("Unsupported conversation goal! " + conversation.getGoalData().getGoal());
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
@ -150,15 +150,15 @@ model.evaluate(npTestData,npTestLabel)
|
||||
|
||||
|
||||
# predict
|
||||
predictTargetRaw: Tensor = tf.constant(['Hello'])
|
||||
npPredict: npt.NDArray = np.array(predictTargetRaw, dtype=object)
|
||||
print("Prediction test..")
|
||||
result: list[int] = model.predict(predictTargetRaw)
|
||||
print("predict result:")
|
||||
print(predictTargetRaw)
|
||||
print(result)
|
||||
print(train_data)
|
||||
print(train_labels)
|
||||
# predictTargetRaw: Tensor = tf.constant(['Hello'])
|
||||
# npPredict: npt.NDArray = np.array(predictTargetRaw, dtype=object)
|
||||
# print("Prediction test..")
|
||||
# result: list[int] = model.predict(predictTargetRaw)
|
||||
# print("predict result:")
|
||||
# print(predictTargetRaw)
|
||||
# print(result)
|
||||
# print(train_data)
|
||||
# print(train_labels)
|
||||
|
||||
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ public class GreetingTests {
|
||||
|
||||
ConvAI.simFrame("Hello");
|
||||
|
||||
assertEquals(Globals.conversation.getGreetingData().getHaveGreeted().size(), 1);
|
||||
assertNotEquals(Globals.conversation.getGreetingData().getHaveGreeted().size(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Loading…
Reference in New Issue
Block a user