Auto generated documentation of Peragro AT: Audio Information Retrieval System (AIRS) code¶
Feed module¶
Feeder module
Takes extracted features from audio and feed it to the elasticsearch apis, which eventually creates and stores index of all extracted features.
-
class
feed.Feeder[source]¶ Feeder class that provides helper functions to feed extracted features to the elasticsearch inorder to create indexes.
-
feed(jsonFile, cont_id, iname='audio_index', doc_type='audio')[source]¶ feed extracted features of an audio to elasticsearch for index creation
- Input:
- jsonFile: a json file of extracted features of an audio
- cont_id : identity of the content
- iname : index name for that group of content
- doc_type: document type to be stored
- output:
- retVal: a boolean return value. true if data is indexed otherwise
false.
-
feedAll(jsonDir, iname='audio_index', doc_type='audio')[source]¶ feed extracted features of all audio from all the files present in jsonDir to elasticsearch for index creation
- Input:
- jsonDir : directory path that contains all json files
- iname : index name for that group of content
- doc_type: document type to be stored
-
Peragro module¶
A client that provides audio search
provides different api(s) for audio search, including text based and content based search.
-
class
peragro.PeragroClient[source]¶ An audio search client
-
get_sound(id_)[source]¶ Get sound by its id
- input:
- -id: id of sound
- output:
- -sound: sound details if it exists otherwise None
Usage:
>>> id = "X2VFAB12GH" >>> sound = c.get_sound(id)
-
Test Feed module¶
Test Feeder module
Provides test methods for automated unit testing of Feeder module
-
class
test_feed.TestFeeder(methodName='runTest')[source]¶ Test Feeder class for unittesting Feeder module
-
id_generator(size=10, chars='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')[source]¶ generate random token of given size
-
setUp()[source]¶ set up method for test fixture
This method runs before each test method. Basically, it setups the test environment
-
Test Peragro module¶
Test peragro module
provides test methods for automated unittesting of peragro module
-
class
test_peragro.TestPeragroClient(methodName='runTest')[source]¶ unit test PeragroClient module
-
setUp()[source]¶ set up method for test fixture
This method runs before each test method. Basically, it setups the test environment
-