S.A.I is a Frontend application for annotating Audio Data.
Frontend - NextJS, Typescript, Redux, TailwindCss, Framer-Motion
Backend - NextJS native server, json files used to mimick as a local DB and
utility functions have been written (using nodejs fs module)
to update json files to mimick
S.A.I requires Node.js >= v14.17.6 to run. Install the dependencies and devDependencies and start the server.
cd web
yarn install
yarn dev
For production environments...
yarn build
yarn start
All the source code
related to Frontend can be found inside
/web/src folder
- src/component contains all the components for business logic
- src/dataTypes contains interfaces / types for base objects, e.g User, Dataset, DataPoint.
as well as actual data files in
json
format e.g. users.json, datasets.json - src/middlewares contains middlewares for NextJS server side api routes
- src/utils contains utility functions
Important Utility Functions
checkConsensusState.ts
- Decides if consensus achieved when a user labels a datapointcheckDatasetTagged.ts
- Decides if dataset should be marked tagged when a users labels a datapointrewardUserScore
- Increases user score once consensus is achieved for a datapointcrudApis.ts
- Mimicks as a read/write/update/delete api to local json files
Sample users that can be used are
Admin
- email -[email protected]
, password -qwerty1234
Reviewer
- email -[email protected]
, password -qwerty1234
Member
- email -[email protected]
, password -qwerty1234
By default 2 datasets have been added
- Cats vs Dogs Dataset
- Customer Care Dataset
One can Navigate here by clicking on any of the datasets in previous page (Datasets Homescreen)
To upload datapoints click on Add / Import Data
( use yarn dev
i.e development server to test import functionality)
๐จ๐จ Caveats
๐จ๐จ
Since public folder of nextjs is being used to store and fetch audio files,
any files uploaded in production i.e after yarn build
and yarn start
won't show up -
As per Next JS Note: Only assets that are in the public directory at build time will be served by Next.js. Files added at runtime won't be available.
One can Navigate here by clicking on ๐ท๏ธ Start Labeling
button in previous screen
Consensus and Scoring logic has been implemented in the frontend itself
Consensus is checked for a datapoint, every time a user annotates that datapoint
- A consensus is achieved and datapoint is marked as
COMPLETE
if the count of majority people with same labels on a datapoint equals or exceedsminimum_consensus
- If Consensus is achieved winners are awarded by increasing their average score
Average score
is calculated based on -- (previousScore*annotation_count + 1) / (annotation_count)annotation_count
is the number of datapoints a particularuser
has labelled historically and is incremented everytime a user labels a datapoint.
Time Constraints might reflect in the source code written in a hurry ๐ , Definitely a room for improvements for a more production ready application.