File size: 4,243 Bytes
bdafe83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import re

from colorama import Fore

problem_pattern = r"(problem|issue|challenge)"
importance_pattern = r"\b(important|challenging|crucial|critical|vital|significant)\b"
interesting_pattern = r"\b(interesting|fascinating|intriguing|exciting)\b"

novel_pattern = r"\b(novel|new|original|innovative|creative)\b"
model_pattern = r"(model|architecture|method|approach|framework)"

experiment_pattern =r"\b(evaluate|evaluation|comparison|result|experiment[s])\b|\b(analysis|analyses)\b"
result_pattern = r"\b(result|performance|metric|score)\b"

insight_pattern = r"\b(insight|observation|finding|trend)\b"


limitation_pattern = r"(limitation|drawback|weakness|challenge)"

scalability_pattern = r"\b(complexity|scalability|scalable)\b"

real_world_pattern = r"realistic|real\-world|practical"


theoretical_pattern = r"\b(math|theoretical|justification|justify|foundation|theory)\b"



def text_match_problem(text):
    """Regex patterns to search for problem-related and importance-related keywords"""

    # Check if both patterns are found in the text
    return re.search(problem_pattern, text, re.IGNORECASE) and (re.search(importance_pattern, text, re.IGNORECASE)
                                                                or re.search(interesting_pattern, text, re.IGNORECASE))


def text_match_dataset(text):
    """
    Check if the strengths mentioned by reviewers contains the word "dataset" or "data set".

    """
    return re.search(r"\b(dataset|data set)\b", text, re.IGNORECASE)


def text_match_model(text):
    """
    Check if the strengths mentioned by reviewers contains the word "model".
    """
    return re.search(model_pattern, text, re.IGNORECASE)

def text_match_experiment(text):
    """
    Check if the strengths mentioned by reviewers contains the word "experiment".
    """
    return re.search(experiment_pattern, text, re.IGNORECASE) or re.search(result_pattern, text, re.IGNORECASE)

def text_match_real_world(text):
    """
    Check if the strengths mentioned by reviewers contains the word "model".
    """
    return re.search(real_world_pattern, text, re.IGNORECASE)

def text_match_theoretical(text):
    """
    Check if the strengths mentioned by reviewers are related to theoretical analysis / foundation.
    """
    return re.search(theoretical_pattern, text, re.IGNORECASE)

def text_match_scalability(text):
    """
    Check if the strengths mentioned by reviewers are related to scalability or time/space complexity.
    """
    return re.search(scalability_pattern, text, re.IGNORECASE)

def match_strengths(text):
    """
    Check if the strengths mentioned by reviewers contains the word "model".
    """
    for category, f in {"problem": text_match_problem,
                        "dataset": text_match_dataset,
                        "model": text_match_model,
                        "limitation": text_match_limitation,
                        "experiment": text_match_experiment,
                        "theoretical-analysis": text_match_theoretical,
                        "scalability": text_match_scalability,
                        }.items():
        if f(text):
            return category

    print(
        Fore.RED
        + f"No category found for weaknesses: {text}"
        + Fore.BLACK
    )

def match_weaknesses(text):
    for category, f in {"problem": text_match_problem,
                        "dataset": text_match_dataset,
                        "model": text_match_model,
                        "limitation": text_match_limitation,
                        "experiment": text_match_experiment,
                        "real-world": text_match_real_world,
                        "theoretical-analysis": text_match_theoretical,
                        "scalability": text_match_scalability,
                        }:
        if f(text):
            return category

    print(
        Fore.RED
        + f"No category found for weaknesses: {text}"
        + Fore.BLACK
    )
    return None

    raise ValueError(f"No category found for weaknesses: {text}")




def text_match_limitation(text):
    """
    Check if the strengths mentioned by reviewers contains the word "model".
    """
    return re.search(limitation_pattern, text, re.IGNORECASE)