Skip to content

Research

Navheen edited this page Nov 9, 2025 · 9 revisions

Technology Research & Justification

This section documents our research, evaluation, and final decisions regarding the technologies used in our project: a Course Comparison Web Application using Sentence Transformers


Overview of Technology Decisions

Area Final Technology Alternatives Considered Justification Summary
Backend FastAPI Flask, Django REST Fast, async, OpenAPI built-in
Frontend React Svelte Large ecosystem, reusable components
Hosting Render Firebase, Vercel Supports full-stack apps, simple setup
NLP Model Sentence Transformers OpenAI Embedding, BERT variants Pretrained, task-optimized, accessible

Backend Framework Research

Final Choice: FastAPI

FastAPI is a modern Python web framework optimized for APIs and asynchronous operations. It auto-generates OpenAPI documentation and offers high performance

Alternatives Considered

Framework Pros Cons
Flask Lightweight, easy to learn Manual setup for async, no built-in docs
Django REST Built-in admin, full-featured Heavier setup, less flexible for APIs only

Why We Chose FastAPI

  • Async support for handling multiple concurrent API calls efficiently
  • Swagger documentation auto-generated by FastAPI
  • Well-documented and developer-friendly syntax
  • Growing community and production use by companies like Netflix and Microsoft

Learning Resources


Frontend Framework Research

Final Choice: React

React is a declarative JavaScript library for building user interfaces. It uses components and a virtual DOM for efficient updates.

Alternatives Considered

Framework Pros Cons
Svelte Very lightweight and fast Less widely adopted, limited libraries

Why We Chose React

  • Familiarity and strong community support
  • Reusable components and modular structure
  • Ideal for single-page applications
  • Compatible with many third-party tools and libraries

Learning Resources


Hosting & Deployment Platform Research

Final Choice: Render

Render is a cloud platform for hosting full-stack applications with support for both frontend and backend deployments.

Alternatives Considered

Platform Pros Cons
Firebase Great for static hosting, built-in DB Not ideal for FastAPI backend
Vercel Great for frontend hosting Backend/serverless functions are limited

Why We Chose Render

  • Supports both FastAPI backend and React frontend
  • Provides custom domains, SSL, Git integration
  • Simplifies CI/CD pipeline for full-stack deployment
  • Free tier suitable for development purposes

Learning Resources


NLP Tool: Sentence Transformers

Final Choice: Sentence Transformers

Sentence Transformers provide state-of-the-art performance for semantic search and sentence similarity.

Alternatives Considered

Model Pros Cons
OpenAI Embedding Powerful, easy to use Requires paid API usage
BERT via HuggingFace Flexible More setup and tuning needed

Why We Chose Sentence Transformers

  • Pretrained models for semantic search and ranking
  • Available via HuggingFace and sentence-transformers Python package
  • Easily integrates with Python backends like FastAPI
  • Active research and academic support

Learning Resources


Reflection on Self-Directed Learning

All team members engaged in independent exploration of new technologies not covered in class (e.g., FastAPI). The decision process included:

  • Comparing multiple tools through documentation and benchmarks
  • Watching tutorials and reading guides
  • Finalizing stack based ease of use, and long-term suitability

Database Choice: SQLite

Final Choice: SQLite

SQLite is a lightweight, file-based relational database that requires no separate server process. It stores all data in a single .db file, making it simple to set up and deploy with minimal configuration.

Alternatives Considered

Database Pros Cons
PostgreSQL Scalable, robust, advanced features Requires server setup, more complex to manage
MySQL Widely used, good performance Requires server process, heavier maintenance

Why We Chose SQLite

  • Zero configuration — no separate database server required
  • Portable — database file can be committed to version control for quick setup after cloning the repo
  • Lightweight — ideal for small to medium datasets like ours
  • Fast for read-heavy operations such as our course search endpoint
  • Fully supported by Python’s built-in sqlite3 module
  • Easy transition path — if needed, we can migrate to PostgreSQL later without major schema changes

Learning Resources


Language Model: GPT-4o-mini

Final Choice: GPT-4o-mini

GPT-4o-mini is a compact, cost-efficient variant of OpenAI’s GPT-4 model optimized for structured reasoning and data extraction.
It is used in the backend to parse course descriptions into structured JSON fields.

Alternatives Considered

Model Pros Cons
GPT-4 High accuracy, advanced reasoning More expensive, slower for frequent parsing
GPT-3.5-Turbo Fast and affordable Less reliable for structured extraction

Why We Chose GPT-4o-mini

  • Supports structured JSON outputs through OpenAI function calling
  • Lightweight and efficient, ideal for frequent backend requests
  • Lower cost while maintaining strong accuracy
  • Seamlessly integrates with Pydantic validation in FastAPI
  • We also didn't have access to the other alternative models considered.

Learning Resources


Embedding Model: all-MiniLM-L6-v2

Final Choice: all-MiniLM-L6-v2

This Sentence Transformers model converts text into numerical embeddings for semantic comparison. It powers the system’s course similarity search.

Alternatives Considered

Model Pros Cons
OpenAI text-embedding-3-small High accuracy, easy API Requires paid API access

Why We Chose all-MiniLM-L6-v2

  • Fast and lightweight (384-dim embeddings)
  • Runs locally, no API cost or latency
  • Perfect balance of speed and accuracy
  • Compatible with NumPy + SQLite for efficient storage and retrieval
  • Recommended by the project lecturer

Learning Resources


Structured Output Parsing

Final Technique: OpenAI Structured Output (Function Calling)

Structured output parsing allows the model to respond in valid JSON format based on a predefined schema, ensuring consistent and machine-readable data.

Why We Chose Structured Output Parsing

  • Enforces strict schema validation using function_call
  • Minimizes parsing errors by returning valid JSON directly
  • Integrates smoothly with Pydantic models for type validation
  • Avoids overhead of external frameworks like LangChain
  • Recommended by the project lecturer

Learning Resources


References

- https://fastapi.tiangolo.com/
- https://render.com/docs/deploy-fastapi
- https://reactjs.org/docs/getting-started.html
- https://sbert.net/
- https://huggingface.co/sentence-transformers
- https://vitejs.dev/guide/
- https://render.com/docs/deploy-react

Clone this wiki locally