diff options
-rw-r--r-- | src/client/ClientRecommender.tsx | 6 | ||||
-rw-r--r-- | src/client/views/Recommendations.scss | 3 | ||||
-rw-r--r-- | src/client/views/Recommendations.tsx | 2 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 2 |
4 files changed, 9 insertions, 4 deletions
diff --git a/src/client/ClientRecommender.tsx b/src/client/ClientRecommender.tsx index a6d1a32b3..9953700cc 100644 --- a/src/client/ClientRecommender.tsx +++ b/src/client/ClientRecommender.tsx @@ -39,6 +39,7 @@ export class ClientRecommender extends React.Component<RecommenderProps> { @action public reset_docs() { ClientRecommender.Instance.docVectors = new Set(); + ClientRecommender.Instance.mainDoc = undefined; ClientRecommender.Instance.corr_matrix = [[0, 0], [0, 0]]; } @@ -133,7 +134,10 @@ export class ClientRecommender extends React.Component<RecommenderProps> { let keyterms = new List<string>(); results.documents.forEach((doc: any) => { let keyPhrases = doc.keyPhrases; - keyPhrases.map((kp: string) => keyterms.push(kp)); + keyPhrases.map((kp: string) => { + const words = kp.split(" "); + words.forEach((word) => keyterms.push(word)); + }); }); return keyterms; }; diff --git a/src/client/views/Recommendations.scss b/src/client/views/Recommendations.scss index 5d8f17e37..6619d8df3 100644 --- a/src/client/views/Recommendations.scss +++ b/src/client/views/Recommendations.scss @@ -27,7 +27,7 @@ padding-bottom: 10px; border-radius: 15px; border: solid #BBBBBBBB 1px; - width: 200px; + width: 250px; text-align: center; max-height: 250px; text-transform: uppercase; @@ -62,4 +62,5 @@ img{ width: 50%; height: 100%; text-align: center; + margin-left: 10px; } diff --git a/src/client/views/Recommendations.tsx b/src/client/views/Recommendations.tsx index cf1974c69..63aa12c29 100644 --- a/src/client/views/Recommendations.tsx +++ b/src/client/views/Recommendations.tsx @@ -161,7 +161,7 @@ export class Recommendations extends React.Component<{}> { <span className="image-background"> {this.DocumentIcon(doc.preview)} </span> - <span className="score">{doc.score}</span> + <span className="score">{doc.score.toFixed(4)}</span> </div> ); })} diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index f708a7a3a..d51c90b61 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -648,7 +648,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu if (!ClientRecommender.Instance) new ClientRecommender({ title: "Client Recommender" }); let documents: Doc[] = []; let allDocs = await SearchUtil.GetAllDocs(); - //allDocs.forEach(doc => console.log(doc.title)); + // allDocs.forEach(doc => console.log(doc.title)); // clears internal representation of documents as vectors ClientRecommender.Instance.reset_docs(); await Promise.all(allDocs.map((doc: Doc) => { |