Skip to content

Commit 7d57548

Browse files
committed
Increased size to add the dummy mail and the output label was not being shown correctly
1 parent 3824939 commit 7d57548

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/features/spam-demo/SpamDemo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const SpamDemo = ({ folder }: MailViewProps ) => {
3838
<p>Current folder: {folder}</p>
3939
<label >Content: </label>
4040
<br></br>
41-
<textarea ref={textInput} placeholder="Content of the message..."/>
41+
<textarea ref={textInput} style={{ width: '100%', height: '300px' }} placeholder="Content of the message..."/>
4242
<div>
4343
<button onClick={evalDemo}>Evaluate</button>
4444
<label id="result">The mail is: {lab}</label>

src/features/spam-demo/detector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function color(v: any) {
149149

150150

151151
function provide_explanation(s_result: string, relevancies: any, outputTokens: any, container: any){
152-
let strexp = `<span style ="color:black"> Your document was labeled as `+ s_result+ ` because of the blue tokens: \n </span>`;
152+
let strexp = `<span style ="color:white"> Your document was labeled as `+ s_result+ ` because of the blue tokens: \n </span>`;
153153
for(let i = 0; i<LENTOKENS;i++){
154154
strexp = strexp.concat(`<span style="color:${color(relevancies[i])}"> <b> ${finalVocab.get(outputTokens[i])} </b> </s> </span> `);
155155
}
@@ -191,7 +191,7 @@ export async function spamOrHam(message: string | undefined, result: any, explan
191191
s_result= "ham";
192192
}
193193
else{
194-
result.innerHTML= "The mail is: spam";
194+
result("The mail is: spam");
195195
s_result = "spam";
196196
}
197197
if (Object.values(running).length > 1 && s_result == "spam"){

0 commit comments

Comments
 (0)