The Aggregation Service is a Spring Boot application designed to process and analyze video transcripts. It provides features to fetch the most frequently occurring words from a video's transcript and other transcript-related data.
- Retrieve the top N most frequent words from a video's transcript.
- REST API for easy integration.
- Supports data storage and retrieval using JPA repositories.
src/main/java: Contains the Java source code, organized into the following packages:controller: Contains REST controllers to handle API requests.service: Includes service interfaces and implementations for business logic.repository: Defines JPA repositories for database interactions.entity: Defines the data model entities.
pom.xml: Maven configuration file for dependency management.persist_transcript.py: A script to fetch video transcripts using the YouTube API.
- Java 17 or higher.
- Maven 3.6 or higher.
- PostgreSQL (or any configured database).
-
Clone the repository:
git clone <repository-url> cd aggregation
-
Configure the database:
- Update the
src/main/resources/application.propertiesfile with your database credentials:spring.datasource.url=jdbc:postgresql://<host>:<port>/<database> spring.datasource.username=<username> spring.datasource.password=<password> spring.jpa.hibernate.ddl-auto=update
- Update the
-
Build the project:
mvn clean install
-
Run the application:
mvn spring-boot:run
Endpoint: GET /top-words
Parameters:
videoId(String): The ID of the video.topN(int): The number of top words to retrieve.
Response: Returns a list of words and their frequencies.
Example:
curl "http://localhost:8080/top-words?videoId=12345&topN=10"Endpoint: GET /word-frequency
Parameters:
videoId(String): The ID of the video.word(String): The word to retrieve the frequency for.
Response: Returns the frequency of the specified word in the video's transcript.
Example:
curl "http://localhost:8080/word-frequency?videoId=12345&word=example"- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed explanation of your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.
For questions or suggestions, please contact the project maintainer at [email@example.com].