|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecthyspirit.engines.HyEngine
hyspirit.engines.HyInferenceEngine
hyspirit.engines.HyPSQLEngine
public class HyPSQLEngine
A PSQL engine runs PSQL (probabilistic SQL) programs. For example:
INSERT INTO index VALUES
0.5 ('sailing', 'doc1'),
0.9 ('boats', 'doc1'),
0.6 ('sailing', 'doc2');
INSERT INTO query VALUES 0.5 ('sailing'), 0.5('boats');
-- Simple retrieval matching query against index:
SELECT DISJOINT * FROM query, index where query.term = index.term;
Describing full-text retrieval with SQL is intutive, but causes quickly scalability problems. For solving this, the Apriorie framework runs external scalable engines. The Java-API engines are just convenient Java front-ends for accessing the functionality of the background engines, that serve knowledge bases.
Apriorie has patented its technology for large-scale probability estimations in PSQL. Basically, there are just two additional clauses needed, namely "ASSUMPTION" and "EVIDENCE KEY".
For example, the following view definition is crucial for IR:
CREATE VIEW invDocFreq AS
SELECT term
FROM docFreq
ASSUMPTION MAX INFORMATIVE
EVIDENCE KEY ();
The view invDocFreq(term) yields a probabilistic interpretation of the common inverse document frequency, an important parameter for relevance-based information retrieval.
Many more retrieval aspects can be described in PSQL. The Apriorie framework comes with various PSQL and other logical programs for implementing retrieval tasks such as classification and ad-hoc retrieval.
| Field Summary |
|---|
| Fields inherited from class hyspirit.engines.HyInferenceEngine |
|---|
deleteQueryProgram, retrieveProgram |
| Fields inherited from class hyspirit.engines.HyEngine |
|---|
argumentString, LOG, stdin, TIME_PREFIX |
| Constructor Summary | |
|---|---|
HyPSQLEngine()
Create an engine. |
|
HyPSQLEngine(java.lang.String fileName)
Create an engine and run (evaluate) the argument file. |
|
| Method Summary | |
|---|---|
protected java.lang.String[] |
buildCommand()
Builds the command from the parameters. |
java.lang.String |
echoSpecial(java.lang.String message)
Returns a string which lets the engine echo the given message |
protected java.lang.String |
getStreamEndMessage()
Returns the stream end message. |
void |
reset()
Resets all parameters of the engine after destroying a possibly running process. |
| Methods inherited from class hyspirit.engines.HyInferenceEngine |
|---|
deleteQuery, deleteQueryProgram, echo, eval, evalFile, nextTuple, retrieve, retrieveProgram, runProgram |
| Methods inherited from class hyspirit.engines.HyEngine |
|---|
closeSTDIN, destroy, exitValue, getCommand, getEngineName, getInputReader, getOutputWriter, getPercentageCPU, getRealTime, getSTDERR, getSTDIN, getSTDOUT, getSysTime, getUserTime, hasNext, isInClientMode, isRunning, kb, kb, kb, next, readFromSTDIN, restart, run, send, send, sendAndReceive, sendFile, setArgumentString, setLogger, start, suppressSTDERR, takesTime, takeTime, waitFor, waitTillRunning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HyPSQLEngine()
throws HySpiritException
HySpiritException
public HyPSQLEngine(java.lang.String fileName)
throws HySpiritException,
java.io.IOException
fileName - the file name
HySpiritException
java.io.IOException| Method Detail |
|---|
protected java.lang.String getStreamEndMessage()
getStreamEndMessage in class HyInferenceEnginepublic java.lang.String echoSpecial(java.lang.String message)
echoSpecial in class HyInferenceEnginemessage - the message to be echoed
public void reset()
run().
reset in class HyEngineprotected java.lang.String[] buildCommand()
HyEnginebuildCommand and
reset methods. Be sure that you place the support for new,
additional parameters somewhere. This means the block
if (this.argumentString != null) {
StringTokenizer strTok= new StringTokenizer(this.argumentString);
while (strTok.hasMoreTokens()) commandVec.add(strTok.nextToken());
}
should appear somewhere in your buildCommand
implementation.
The output of this method is used in the run() method.
buildCommand in class HyEngine
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||