Comments (3)
Yes, good idea. Tweaking the Graph
API is actually the straightforward part (we can add a batch
argument in the Graph
initializer, which, when True
, passes all Stims to each node in the graph as a single list, and when False
, loops over Stims). The real question is how to handle looping in the Transformer
and Stim
classes. I can think of two reasonable approaches:
A) Create an IterableTransformer
class that can be mixed into any Transformer
, and simply overrides the base Transformer
class's transform
method to loop over elements and return the resulting dict as a list (or, with an optional merge_results
argument, perhaps a merged DF). Transformers that require custom handling of batch requests (which is probably all of the API Extractors), will need to be updated on a case-by-case basis.
B) In the base Transformer
, add an _iterate
method or some such, which gets called from the base Transformer
class's transform
method in the event that the passed stim
argument is a list or tuple. Then the logic is roughly the same as in (A), in that the base class's method can just loop over all elements one at a time, whereas individual Transformers can override _iterate
and do whatever they need to there.
The main benefit of (A) is it avoids imposing constraints on how each API Transformer implements the handling of lists (no need to break up code into multiple methods, which could get messy in some cases). The benefit of (B) is it avoids complicating the hierarchy and doesn't require most Transformers to inherit from an extra class. I guess I lean towards (B) slightly, on the assumption that the vast majority of Transformers will never need to do anything other than naive looping. What do you think?
from pliers.
I would lean towards (B) more as well, as I generally side with a simpler hierarchy. I would also assume that every Transformer will fall into one of two (naive looping, grouping into call) types.
from pliers.
Addressed in #69.
from pliers.
Related Issues (20)
- bertLMExtractor post processing error HOT 1
- Shot detection not working
- add librosa F0 extractor
- args missing from MFCCEnergyExtractor docstring
- rename mel features
- naming mel features by frequency bands
- Unable to run examples HOT 11
- clarifai deprecation ; clarifai-grpc support ? HOT 6
- End-of-life for MicrosoftAPIFaceEmotionExtractor HOT 1
- MNT: Tests failing
- google-api-python-client updates HOT 1
- Switch to ReadTheDocs HOT 1
- Fix coveralls
- Allow for non-English transcription with Rev.AI HOT 4
- Remove Indico from examples HOT 2
- Document limits on Google Cloud requests ? HOT 1
- Implement FaceNet clustering extractor HOT 1
- adding PySceneDetect to plier HOT 5
- Upcoming Clarifai API change HOT 6
- Add Speaker diarization model HOT 5
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 pliers.