AI Content Recommendation Assistant Project

Artificial Intelligence project 10

AI Content Recommendation Assistant Project

Build a complete content recommendation assistant workflow with reproducible Python code, transparent inputs, reviewable output, and responsible-use limits.

Explore AI training in VizagView all project ideas

AI objective

Recommend items whose descriptions are most similar to a selected catalogue item.

Data or knowledge source

Seven fictional learning items with transparent descriptions and topic tags.

Requirements

  • Python 3.10 or later
  • A terminal or command prompt
  • python -m pip install pandas scikit-learn
  • About 45-60 minutes to build and review

How the system works

Fit TF-IDF features on item descriptions, calculate item-to-item cosine similarity, remove the seed item, and return the top alternatives.

Validation checklist

  • The selected item never recommends itself
  • Unknown titles raise a clear error
  • Similarity stays between zero and one
  • No personal profile is created

Complete Python code

Save the program as ai_content_recommendation_assistant.py. The code runs locally and requires no paid API key or model download.

"""Recommend content by comparing transparent item descriptions."""

from __future__ import annotations

import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity


def catalogue() -> pd.DataFrame:
    return pd.DataFrame([
        ("Python Foundations", "python programming functions files beginner"),
        ("Python Data Work", "python pandas data cleaning tables"),
        ("SQL Reporting", "sql queries joins aggregation reporting"),
        ("Power BI Dashboard", "power bi dax dashboard business metrics"),
        ("NLP Basics", "artificial intelligence natural language text classification"),
        ("RAG Systems", "artificial intelligence retrieval documents question answering"),
        ("Cloud Deployment", "cloud deployment containers monitoring"),
    ], columns=["title", "description"])


def recommend(items: pd.DataFrame, title: str, limit: int = 3) -> pd.DataFrame:
    matches = items.index[items["title"].str.casefold() == title.casefold()].tolist()
    if not matches:
        raise ValueError(f"Unknown title: {title}")
    matrix = TfidfVectorizer(ngram_range=(1, 2)).fit_transform(items["description"])
    scores = cosine_similarity(matrix[matches[0]], matrix)[0]
    order = [index for index in scores.argsort()[::-1] if index != matches[0]][:limit]
    result = items.loc[order, ["title"]].copy()
    result["similarity"] = scores[order]
    return result.reset_index(drop=True)


def main() -> None:
    print(recommend(catalogue(), "NLP Basics").round(3).to_string(index=False))
    print("Content similarity is not a claim about an individual learner's ability or preference.")


if __name__ == "__main__":
    main()

Run the project

  1. Create and activate a virtual environment.
  2. Install dependencies with python -m pip install pandas scikit-learn when packages are required.
  3. Run python ai_content_recommendation_assistant.py.
  4. Review confidence, fallbacks, sources, or error metrics rather than accepting output automatically.
  5. Test additional normal, edge, unsupported, and adversarial inputs.

Expected output

A ranked content table with title and similarity score.

Accuracy, privacy, and responsible-use limits

Content similarity is not evidence about learner ability, preference, or suitability. Real recommenders require privacy, diversity, availability, feedback-loop, and popularity-bias controls.

Ways to extend the project

Add user-approved interests, diversity re-ranking, prerequisites, completion status, cold-start handling, and offline ranking evaluation.

Continue learning Artificial Intelligence

Try the next project, return to the Softenant project library, or explore the AI training in Vizag for guided NLP, retrieval, evaluation, automation, and responsible AI practice.