Intermediate AI Projects

Updated · 7 min read
mediumPython 3.13aiprojectsragclassificationevaluationportfolio

Intermediate AI projects use code to build something that runs on its own: a retrieval app, a classifier, a recommender. They use the skills from the building chapters of this course (Python, model APIs, embeddings, RAG and evaluation) and they end with a measured result on data the system never saw. Each project has a "done when" check: a concrete result you can show, not just "it works".

The Projects

ProjectDone when
Customer feedback analyzer100 comments are classified by theme and sentiment, with accuracy checked on 20 by hand
AI-powered knowledge assistantIt answers from a document collection and shows its sources
Document-based RAG applicationAn evaluation set of 30 questions has a measured score; see "Building a RAG Pipeline"
Product recommendation prototypeRecommendations come from embeddings and are explained for three users; see "Semantic Search"
Support ticket classifierA precision and recall report on held-out tickets

Example: A Support Ticket Classifier

This program builds the last project at small scale: made-up support tickets for a school's parent portal, sorted into billing, login, schedule and other, with a report on 60 held-out tickets.

Code that runs on its own, measured on data it never saw
Python
import random
 
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report
 
# Made-up support tickets for a school's parent portal, built from phrases with some overlap between kinds
PHRASES = {
    "billing": ["I was charged twice", "my card payment failed", "the fee amount looks wrong", "I need a receipt",
                "refund for the canceled trip", "why is there a late fee"],
    "login": ["I can't log in", "password reset email never came", "my account is locked",
              "the portal says wrong password", "two-step code not arriving"],
    "schedule": ["where is my child's timetable", "the class schedule is missing", "exam dates are not showing",
                 "the calendar shows the wrong week", "when is the parent meeting"],
    "other": ["the website is slow", "please update my phone number", "how do I join the newsletter",
              "the page looks broken on my phone", "who do I talk to about the bus"],
}
EXTRA = ["please help", "thank you", "on the portal", "since yesterday", "for my son", "for my daughter", "again", ""]
 
rng = random.Random(35)
tickets = [(f"{rng.choice(PHRASES[k])} {rng.choice(EXTRA)} {rng.choice(PHRASES[rng.choice(list(PHRASES))]) if rng.random() < 0.25 else ''}".strip(), k)
           for k in PHRASES for _ in range(55)]
rng.shuffle(tickets)
train, test = tickets[:160], tickets[160:]               # 60 tickets kept aside, never trained on
print(f"{len(train)} training tickets, {len(test)} held-out tickets")
print("Example:", test[0])
 
vectorizer = TfidfVectorizer(ngram_range=(1, 2))
X_train = vectorizer.fit_transform([t for t, _ in train])
model = LogisticRegression(max_iter=1000).fit(X_train, [k for _, k in train])
predicted = model.predict(vectorizer.transform([t for t, _ in test]))
print(classification_report([k for _, k in test], predicted, digits=2, zero_division=0))
Output
160 training tickets, 60 held-out tickets
Example: ('password reset email never came', 'login')
              precision    recall  f1-score   support
 
     billing       0.94      0.88      0.91        17
       login       0.93      1.00      0.97        14
       other       0.93      0.93      0.93        15
    schedule       1.00      1.00      1.00        14
 
    accuracy                           0.95        60
   macro avg       0.95      0.95      0.95        60
weighted avg       0.95      0.95      0.95        60

Explanation:

  • Each ticket is built from a phrase of its kind, a few extra words, and sometimes (25% of the time) a phrase from another kind, to make them harder to sort.
  • TfidfVectorizer turns each ticket into word and word-pair weights, and logistic regression from "Logistic Regression and Classification" learns which ones point to which kind. The 60 test tickets are never used in training.
  • classification_report gives precision and recall for each kind, as in "Evaluating Models: Metrics". Overall accuracy is 0.95; billing has the lowest recall (0.88), so a few billing tickets were sent elsewhere.
  • This is a starting point, not a final result. The made-up tickets reuse a small set of phrases, so they are much easier than real ones. In your project, use real tickets (with personal data removed), and expect lower scores. Report them honestly.

What Makes an Intermediate Project Stand Out

QualityExample
Real data200 real, anonymized tickets instead of made-up ones
A baselineCompare with a simple rule or keyword search; is the AI better?
Error analysisLook at every mistake and group them by cause
A simple interfaceA small web page or command-line tool someone else can use
A clear READMEHow to run it, what it scored, and its limits

Common Mistakes

Testing on training data. Keep a held-out set from the start.

Reporting only accuracy. Per-category precision and recall show where it fails.

Made-up data presented as real. Say clearly what is synthetic.

No baseline. Without one, you can't tell whether AI was needed.

Interview Corner

How did you evaluate your classifier?

On a held-out test set it never trained on, with precision and recall per category and overall accuracy, compared with a simple baseline, plus a look at every mistake. Then I named the weakest category and what I'd do about it.

What is the difference between precision and recall?

Precision is how many of the items the model put in a category really belong there; recall is how many of the items that belong in the category the model found. A support system might care most about recall for urgent tickets.

Practice

Exercise: a baseline. Write a keyword rule (for example: "password", "log in" or "locked" means login; "charged", "fee" or "refund" means billing) and score it on the same 60 test tickets. How does it compare with the classifier's 0.95?

Check your understanding:

  1. Why are 60 tickets kept aside?
  2. Which category had the lowest recall, and what does that mean?
  3. Why would real tickets score lower?

Quick check: intermediate projects

4 questions
1What was the classifier's accuracy on held-out tickets?
2Which category had the lowest recall?
3Why compare with a baseline?
4What is the "done when" for the RAG application?

Key Takeaways

Quick reference

NeedCode or practice
Text featuresTfidfVectorizer(ngram_range=(1, 2))
ClassifierLogisticRegression(max_iter=1000)
Per-category reportclassification_report(y_true, y_pred)
Honest testingA held-out set, never used in training
ContextA simple baseline to compare against

Was this tutorial helpful?

Lesson 180 of 186