Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnosis interface 2024 s #8

Open
wants to merge 105 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
12442c5
new page
gragragrace Oct 24, 2023
e01ca7c
add hypo
gragragrace Oct 24, 2023
5f9f8e4
context space
gragragrace Oct 24, 2023
db6d9af
RC list
gragragrace Oct 24, 2023
520885e
fixed hypo list
gragragrace Oct 24, 2023
a1ae121
updated context-space
gragragrace Oct 24, 2023
8b7a6fa
create and read
gragragrace Oct 24, 2023
ea855ad
Create orchestration-scripting-interfaces.code-workspace
gragragrace Oct 26, 2023
ddad9cc
minor edits
gragragrace Oct 26, 2023
9204169
minor
gragragrace Oct 26, 2023
096cadf
ostest context
gragragrace Oct 29, 2023
b89b72c
need fix edge case
gragragrace Oct 29, 2023
eecdce2
fixed DTR edge case
gragragrace Oct 29, 2023
646984e
fixed json PRC
gragragrace Oct 29, 2023
dc81c44
my-stuff
NoodleSoup0 Oct 29, 2023
3c18123
add PRC
NoodleSoup0 Oct 29, 2023
4033bdd
add PRC URL
NoodleSoup0 Oct 29, 2023
c18d2ee
fixes
gragragrace Oct 29, 2023
deb95ca
Merge branch 'diagnosis-interface' of https://github.com/NUDelta/orch…
gragragrace Oct 29, 2023
77ec30a
minor naming fix
gragragrace Oct 29, 2023
4c89990
Get project object from OS, populate context space, and update response
gragragrace Nov 5, 2023
565616b
update context, context_lib
gragragrace Nov 5, 2023
0ca3a9f
summary of stories and task
gragragrace Nov 5, 2023
4582c35
save response setup
gragragrace Nov 5, 2023
a522357
update hypothesis list
gragragrace Nov 5, 2023
c713e66
update description
gragragrace Nov 5, 2023
99d5853
delete hypo
gragragrace Nov 5, 2023
d44242d
retrieve slide obj
NoodleSoup0 Nov 6, 2023
086352a
object done, need to see how to add more than one slide for user_stud…
NoodleSoup0 Nov 6, 2023
384bf9d
object done, need to see how to add more than one slide for user_stud…
NoodleSoup0 Nov 6, 2023
1917b55
object done, need to see how to add more than one slide for user_stud…
NoodleSoup0 Nov 6, 2023
c090825
object done, need to see how to add more than one slide for user_stud…
NoodleSoup0 Nov 6, 2023
67de856
fetchactiveissue and createresponse
gragragrace Nov 7, 2023
47ba731
minor fixed for index.tsx
gragragrace Nov 7, 2023
fef2774
comments for linh
gragragrace Nov 8, 2023
9c2d7b5
stuff
NoodleSoup0 Nov 8, 2023
43de298
merge
NoodleSoup0 Nov 8, 2023
976bba3
added PRC-link and DTR Breakdown
NoodleSoup0 Nov 8, 2023
1128d9f
Remove Button
NoodleSoup0 Nov 8, 2023
59509b5
needs formatting for stories and tasks
NoodleSoup0 Nov 8, 2023
3693260
fixed fetch os object error
gragragrace Nov 8, 2023
4bb1b0e
user study
gragragrace Nov 8, 2023
200932c
delete diag.tsx
gragragrace Nov 9, 2023
94f091c
canvas space
gragragrace Nov 12, 2023
5ee54c4
add rc
NoodleSoup0 Nov 12, 2023
248e1d3
Merge branch 'diagnosis-interface' of https://github.com/NUDelta/orch…
NoodleSoup0 Nov 12, 2023
d1f8d1c
minor fix
gragragrace Nov 12, 2023
c76a982
merge
NoodleSoup0 Nov 13, 2023
4936bfb
Merge branch 'diagnosis-interface' of https://github.com/NUDelta/orch…
NoodleSoup0 Nov 13, 2023
682264a
1
gragragrace Nov 13, 2023
d9a8b65
Merge branch 'diagnosis-interface' of https://github.com/NUDelta/orch…
gragragrace Nov 13, 2023
92ae1ff
working merge
gragragrace Nov 13, 2023
928129c
update RC Lib
gragragrace Nov 13, 2023
859b748
P5 setup
gragragrace Nov 13, 2023
2c97623
user study withJonah edits
gragragrace Nov 14, 2023
691fc16
deployment fix
gragragrace Nov 15, 2023
e68c1d7
deployment fix
gragragrace Nov 15, 2023
221c20f
minor fixes
gragragrace Nov 15, 2023
61cc5cb
p5js elements' features
NoodleSoup0 Nov 28, 2023
b5a8fa7
individual points spent & committed
NoodleSoup0 Nov 28, 2023
9ab64cf
usability fixes
gragragrace Nov 28, 2023
d1771f4
updates
gragragrace Nov 29, 2023
ea4f14a
new page view
gragragrace Feb 14, 2024
e1a0a27
added components + clean up files
gragragrace Feb 14, 2024
f19ad50
strategy button + update save functions for initial hunch and game plan
gragragrace Feb 14, 2024
e27eb5b
deployment fix
gragragrace Feb 14, 2024
cdc05c6
package fixes
gragragrace Feb 14, 2024
a72e501
specifying engine for digital ocean; updating packages
kapil1garg Feb 14, 2024
ee74b64
trying again with node engine
kapil1garg Feb 14, 2024
b004ce7
fml its ENGINES not ENGINE
kapil1garg Feb 14, 2024
00cff8b
add context for useability test
NoodleSoup0 Feb 15, 2024
d8d7d93
context space prompt
gragragrace Feb 19, 2024
3303e2a
Revert "context space prompt"
gragragrace Feb 25, 2024
2a508d6
Revert "add context for useability test"
gragragrace Feb 25, 2024
298bc84
weird bug about node version
gragragrace Feb 25, 2024
9a95cb8
deployment fix
gragragrace Feb 26, 2024
405a032
deployment fixes
gragragrace Mar 12, 2024
955d718
testing fetch
NoodleSoup0 Apr 7, 2024
437a436
manual fix for getContext bc OS is down
gragragrace Apr 7, 2024
9a6f201
simple affordances
NoodleSoup0 Apr 7, 2024
97dabe8
suggestedIssues component + js TFIDF monstrosity"
gragragrace Apr 8, 2024
5f0bda5
display suggestion base on insight"
gragragrace Apr 8, 2024
4e363b9
saving textareas
gragragrace Apr 8, 2024
a70e983
multiple tabs for RCModels
gragragrace Apr 8, 2024
2b8b27e
add RC tab
gragragrace Apr 8, 2024
30e9cdc
saving added tabs
gragragrace Apr 8, 2024
976874f
delete tabs and save to db
gragragrace Apr 8, 2024
a61f03c
change structure
gragragrace Apr 9, 2024
53f63f1
fix saving hypo to DB
NoodleSoup0 Apr 9, 2024
ee9e592
give each tab a hypolist
NoodleSoup0 Apr 9, 2024
e4e0fce
made separate hypo for each tab, but not saving to db
NoodleSoup0 Apr 9, 2024
59857af
fixed hypo multithread saving issue
gragragrace Apr 9, 2024
1014e1b
fix layout
gragragrace Apr 9, 2024
daf158e
fetch from RClibary;
gragragrace Apr 10, 2024
92268b0
Changing fetch RClib to serverside
gragragrace Apr 10, 2024
5f2f727
omit low TFIDF similarities
gragragrace Apr 10, 2024
b99383c
add stemming
gragragrace Apr 10, 2024
9ff07e3
upgrade set of stopwords used
gragragrace Apr 10, 2024
7d15c92
SEAAARCH issues in the issuelib
gragragrace Apr 10, 2024
6fb6ec6
formatting add button for suggestedIssues
gragragrace Apr 10, 2024
2d13661
add stemming and stop word removal to search
gragragrace Apr 10, 2024
954965a
update datamodel for addtotabs
gragragrace Apr 10, 2024
f81b9cf
add button in search
gragragrace Apr 10, 2024
ce6c9c7
better formatting for hypo list
gragragrace Apr 10, 2024
593c2da
checkboxes
gragragrace Apr 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fetch from RClibary;
  • Loading branch information
gragragrace committed Apr 10, 2024
commit daf158ed023083e02cf6b2b3bd03de3c285d86f4
48 changes: 32 additions & 16 deletions lib/TFIDF.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
const natural = require('natural');
const _ = require('lodash');
const { ENGLISH_STOP_WORDS } = require('./stopWords.js');
const connectMongo = require("../utils/connectMongo.js")

async function getIssuesFromDatabase() {
try {
const issues = await connectMongo({ find: "RCLibrary" });
return issues.map(issue => ({
title: issue.issue_title,
description: issue.description
}));
} catch (error) {
console.error("Error fetching issues from database:", error);
return [];
}
}

function preprocess(text) {
return text.toLowerCase();
Expand All @@ -13,15 +27,9 @@ function cosineSimilarity(vectorA, vectorB) {
return dotProduct / (magnitudeA * magnitudeB);
}

function getTopSimilarIssues(mentorNote, topN = 3) {
const issues = [
{ title: "students not understanding some core part of the conceptual approach and it's really affecting what they are doing practically",
description: "students have gaps of understanding in their conceptual approach so that it's difficult to advance their practical design. Some common signals include can't articulate some part of their conceptual approach and vagueness in conceptual understanding." },
{ title: "students being too hard on themselves",
description: "students put a lot of pressure on themselves to work more and deliver, sometimes feeling bad from failing to meet a pre-establish goal or letting others down. They often have a high standard for themselves. Some common signals are being a perfectionist, being stressed or anxious, and having fear of failure." },
{ title: "student not planning with clear deliverables",
description: "when students plan their sprint, they don't have a clear deliverable in mind such as a prototype, user journey, or a section of the canvases that would clearly show how they addressed their riskiest risk. Some common signals are story with empty purpose/deliverable in sprint log, their idea of what form of deliverable would showcase their new understanding is undeveloped or vague." }
];
async function getTopSimilarIssues(mentorNote, topN = 3) {
const issues = await getIssuesFromDatabase();
console.log(issues)

mentorNote = preprocess(mentorNote);

Expand All @@ -45,9 +53,9 @@ function getTopSimilarIssues(mentorNote, topN = 3) {
return _.sortBy(vector, 'term');
});

// Print TF-IDF vector for mentor notes
console.log("TF-IDF Matrix note:");
console.table(tfidfMatrix[0]);
// // Print TF-IDF vector for mentor notes
// console.log("TF-IDF Matrix note:");
// console.table(tfidfMatrix[0]);

// Compute cosine similarity between mentor's note and issue descriptions
const mentorVector = tfidfMatrix[0].map(term => term.tfidf);
Expand Down Expand Up @@ -75,8 +83,16 @@ function getTopSimilarIssues(mentorNote, topN = 3) {

module.exports = { getTopSimilarIssues };

// const mentorNote = "Ella being too hard on herself and not focusing on risks (when everything looks like one) - Ended up over focusing on what happened in an ineffective user test - Freaked out about a poor user test and that drove a lot of her attention";
// // const mentorNote = "Purpose missing because they are still not explicit about what milestones they want to hit --- the deliverables are unclear too so it's all related? Not having a clear sense of what the deliverable should actually be or look like"
// async function testTFIDF() {
// const mentorNote = "Ella being too hard on herself and not focusing on risks (when everything looks like one) - Ended up over focusing on what happened in an ineffective user test - Freaked out about a poor user test and that drove a lot of her attention";
// // const mentorNote = "Purpose missing because they are still not explicit about what milestones they want to hit --- the deliverables are unclear too so it's all related? Not having a clear sense of what the deliverable should actually be or look like"

// try {
// const topSimilarIssues = await getTopSimilarIssues(mentorNote);
// console.log("Top similar issues:", topSimilarIssues);
// } catch (error) {
// console.error("Error:", error);
// }
// }

// const topSimilarIssues = getTopSimilarIssues(mentorNote);
// console.log("Top similar issues:", topSimilarIssues);
// testTFIDF();
51 changes: 0 additions & 51 deletions lib/TFIDF.py

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@mantine/next": "^6.0.21",
"@vygruppen/spor-accordion-react": "^1.0.1",
"blockly": "^10.3.1",
"child_process": "^1.0.2",
"dotenv": "^16.4.4",
"embla-carousel-react": "^7.1.0",
"framer-motion": "^11.0.5",
Expand Down
7 changes: 0 additions & 7 deletions pages/api/test/get_scripts.js

This file was deleted.

11 changes: 4 additions & 7 deletions utils/connectMongo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { MongoClient, ServerApiVersion } = require('mongodb');
// Create a MongoClient with a MongoClientOptions object to set the Stable API version

export default async function connect(command) {
async function connect(command) {
const client = new MongoClient(process.env.MONGO_URI, {
serverApi: {
version: ServerApiVersion.v1,
Expand All @@ -14,26 +14,23 @@ export default async function connect(command) {
let response = null

try {
// Connect the client to the server (optional starting in v4.7)
await client.connect();
// Send a ping to confirm a successful connection
output = await client.db("test").command(command);
} finally {
// Ensures that the client will close when you finish/error
await client.close();
}

if (command.insert){
response = output.ok
// console.log('CONNECT INSERT COMMAND')
} else if (command.findAndModify) {
response = output?.value
// console.log('CONNECT findAndModify COMMAND')
// console.log('MODIFIED: ', response)
}
else if (command.find || command.filter) {
response = output?.cursor.firstBatch
}

return response
}
}

module.exports = connect;
6 changes: 6 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2004,6 +2004,11 @@ chalk@^4.0.0:
ansi-styles "^4.1.0"
supports-color "^7.1.0"

child_process@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/child_process/-/child_process-1.0.2.tgz#b1f7e7fc73d25e7fd1d455adc94e143830182b5a"
integrity sha512-Wmza/JzL0SiWz7kl6MhIKT5ceIlnFPJX+lwUGj7Clhy5MMldsSoJR0+uvRzOS5Kv45Mq7t1PoE8TsOA9bzvb6g==

chokidar@^3.5.3:
version "3.6.0"
resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz"
Expand Down Expand Up @@ -4704,6 +4709,7 @@ streamsearch@^1.1.0:
integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0:
name string-width-cjs
version "4.2.3"
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down