Demo Preview
App & User Interface
The entry point is App.java
, a JavaFX Application that loads the FXML scene
Searching.fxml
into a 1920×1080
stage:contentReference[oaicite:0]{index=0}.
- FXML: Defines UI layout with a search bar, scroll pane for results, and toggle buttons.
- Controller:
PrimaryController.java
handles search button events, toggling search mode (title vs tags), and passing queries to the algorithm:contentReference[oaicite:1]{index=1}.
Vdeo Data & Nodes
Each video is wrapped in a MarkovNode
containing:
- Video ID + metadata (title, tags, views, likes, dislikes, comments):contentReference[oaicite:2]{index=2}
- Arrays of linked node IDs (
ProbIDs
) and their probability coefficients (ProbCoefficients
).
Nodes track how likely one video leads to another. Clicking videos updates probabilities, strengthening links between them:contentReference[oaicite:3]{index=3}.
Markov Chain Model
The MarkovChain
class builds a probabilistic network of video nodes:
- On initialization, every video becomes a node:contentReference[oaicite:4]{index=4}.
- Each pair of videos gets an initial probability coefficient.
- User interactions call
alterProbability()
, reinforcing the edge from a previous node to the clicked node:contentReference[oaicite:5]{index=5}.
User clicks video B after video A: → prevNode.changeProb(B, +1) → Increases probability coefficient → Video B more likely to appear in future searches
Search Algorithm
The SearchAlgorithm
class implements fuzzy matching + weighted ranking:
- Uses FuzzyWuzzy (
partialRatio
) to match search term against titles or tags:contentReference[oaicite:6]{index=6}. - Scores videos with a weighted formula:
- Comments × 15
- Likes × 10
- Views × 1
- Dislikes × –5:contentReference[oaicite:7]{index=7}
- Normalizes scores relative to max probability.
- If a previous click exists, blends click probabilities with content-based relevance:contentReference[oaicite:8]{index=8}.
- Sorts results numerically for display:contentReference[oaicite:9]{index=9}.
Result: A personalized, evolving ranking of videos.
Controller Flow
The UI’s PrimaryController
ties everything together:
- User types a query in
txtSearch
. - Clicks Search → calls
SearchAlgorithm
with current MarkovChain:contentReference[oaicite:10]{index=10}. - Receives a
Hashtable<MarkovNode, Double>
of results (video nodes with probabilities). - Passes results to
generateImaging()
for rendering thumbnails + stats. - User clicks a video → updates Markov chain, reinforcing personalization:contentReference[oaicite:11]{index=11}.
Summary of Systems
- UI Layer: JavaFX FXML + Controller
- Data Layer: Video objects wrapped in MarkovNodes
- AI/Logic: MarkovChain + SearchAlgorithm
- Feedback Loop: User clicks → adjust probabilities → improve personalization