Comments (8)
You don't access the Result
object directly as it is a trait. My suggestion is to implemented it as a function that accepts another function as an argument and returns the appropriate result including the timing.
For example if the original function was analyseString(myString:String):StringResult
then instead of calling this, we would do something like...
val origFunction = analyseString(myString:String):StringResult
def timedQuery(text:String, analysisFunction:(String) => StringResult):Result = {
val startTime = System.currentTimeMillis
val result = analysisFunction(text)
val queryTime = System.currentTimeMillis - startTime
// Copy the result object and add in the queryTimeValue here
// Return the new result
}
// Where the original function was called, we wrap it in the timeQuery function like this...
val newResult = timedQuery(text, origFunction)
from tap.
Is query time the starting time or the processing time?
from tap.
The processing time. Should be able to do this with System.currentTimeMillis()
from tap.
It should be (end time - start time), shouldn't it? If so, the start time has to be inputted along with the query?
from tap.
Yes, record the start time before the analysis, get the end time after the analysis, and add it to the Result
object before it is returned by the GraphQL Controller.
from tap.
I have a problem with accessing fields of the Result
object.
from tap.
I tried to write a function similar to timedQuery but with different types such as StringResult, SentencesResult, .... However, I was not successful. So this version has some duplicated codes for different case classes.
from tap.
See comment in PR.
from tap.
Related Issues (20)
- TAP user documentation needs to be updated to refer to new features
- We need an exemplar Jupyter notebook for each query
- We need an integration test for every query based on the exemplar queries
- Setup batch mode query
- Batch check query
- TAP should correct annotate 'hate' as emotion in reflectExpressions query
- Batch query needs to handle common pipelines
- Add Vader Sentiment Analysis
- Check batch affect and compare with realtime affect
- ReflectExpression Batch
- Vocab Batch
- Metrics Batch
- Expressions Batch
- Syllables Batch
- Spelling Batch
- PosStats Batch
- Quick Start needs to be updated HOT 3
- Update project Structure Documentation
- Merge normal results and batch results
- Spelling Query is not returning expected results with Tap Client.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tap.