Commit 2e5e1d38 authored by Chris's avatar Chris
Browse files

Course change: we will use sample spam messages rather than top 5 words

parent 38555af0
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -229,10 +229,7 @@ def switchCurrentAlgorithm():
    pass

def getPerformanceMetrics():
    if len(X) == 0:
        preprocessing()
    
    if tree == None:
        loadModels()

    pass

def getSampleMessages():
    pass
 No newline at end of file
+1 −2
Original line number Diff line number Diff line
@@ -56,8 +56,6 @@ def getTopAlgorithms():
    recall = ["1", "2", "3", "4", "5"]
    accuracy = ["1", "2", "3", "4", "5"]

    name, f1, precision, recall, accuracy = ml.getPerformanceMetrics()

    val = {
        "name": name,
        "f1": f1,
@@ -71,6 +69,7 @@ def getTopAlgorithms():
@app.route('/getWords', methods=["GET"])
def getTopFiveWords():
    word = ["Larry", "Schultheis", "Larry", "Schultheis", "Larry"]
    
    val = {
        "words": word
    }
+7 −7
Original line number Diff line number Diff line
@@ -25,14 +25,14 @@
        </div>
        <br>
        <!-- List used in spam -->
        <div id="spam_words_list">
            <p>Top 5 words most commonly used in spam:
        <div id="spam_messages_list">
            <p>Some random sample spam messages (unanimously voted by all 4 algorithms):
                    <ol>
                        <li id="top1">Sex</li>
                        <li id="top2">Prize</li>
                        <li id="top3">Singles</li>
                        <li id="top4">Larry</li>
                        <li id="top5">Win</li>
                        <li id="top1">Message 1</li>
                        <li id="top2">Message 2</li>
                        <li id="top3">Message 3</li>
                        <li id="top4">Message 4</li>
                        <li id="top5">Message 5</li>
                    </ol>
                </p>
        </div>
+2 −2
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ function getTopAlgorithms() {
}

// todo get actual values from ml.py
function getTopFiveWords() {
function getSampleMessages() {
    var url = "http://localhost:8080"
    var endpoint = "/getWords"

@@ -190,7 +190,7 @@ function getTopFiveWords() {
// called on index.html load: gets the top 5 algorithms and the top 5 words from server.py
function initializeIndex() {
    getTopAlgorithms();
    getTopFiveWords();
    getSampleMessages();
}

// when the Clear button is pressed, clear the message textarea