Skip to content

Commit

Permalink
Set up new metadata collections
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquelinecai committed Oct 27, 2024
1 parent 6963acc commit 51c42cb
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions server/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,46 @@ export const Validation = mongoose.model<ValidationDocument>(
"validation",
ValidationSchema,
);

/**
* Course Recommendation Metadata Collection
* Stores course description preprocessing data and pre-computation steps for
* similarity algorithm
*/
const RecommendationMetadataSchema = new Schema({
_id: { type: String },
classSub: { type: String },
classNum: { type: String },
processedDescriptions: { type: String },
tfidfVector: { type: Map, of: Number },
});

interface RecommendationMetadataDocument extends mongoose.Document {
_id: string;
classSub: string;
classNum: string;
processedDescription: string;
tfidfVector: Map<string, number>;
}

export const RecommendationMetadata = mongoose.model<RecommendationMetadataDocument>(
"recommendationMetadata",
RecommendationMetadataSchema,
);

/**
* Global Course Metadata Collection
* Stores global course data
*/
const GlobalMetadataSchema = new Schema({
idfVector: { type: Map, of: Number }
});

interface GlobalMetadataDocument extends mongoose.Document {
idfVector: Map<string, number>;
}

export const GlobalMetadata = mongoose.model<GlobalMetadataDocument>(
"globalnMetadata",
GlobalMetadataSchema,
);

0 comments on commit 51c42cb

Please sign in to comment.