DIVYA-NSHU99 commited on
Commit
a86802e
·
verified ·
1 Parent(s): 5ef3419

Update app/src/main.py

Browse files
Files changed (1) hide show
  1. app/src/main.py +2 -4
app/src/main.py CHANGED
@@ -19,10 +19,10 @@ class TrademarkAnalyzer:
19
  if "HF_HOME" not in os.environ:
20
  os.environ["HF_HOME"] = "/tmp/huggingface"
21
 
22
- # Initialize sub-modules
23
  self.linguistic = LinguisticAnalyzer(descriptive_keywords_path)
24
  self.embedding = EmbeddingSimilarity() # uses sentence-transformers
25
- self.cross_encoder = CrossEncoderSimilarity()
26
  self.heuristic = DescriptivenessHeuristic(
27
  self.linguistic,
28
  self.embedding,
@@ -32,12 +32,10 @@ class TrademarkAnalyzer:
32
  def analyze(self, mark, goods, goods_class=None):
33
  """
34
  Perform full descriptiveness analysis.
35
-
36
  Args:
37
  mark (str): The trademark text.
38
  goods (str): Description of goods/services.
39
  goods_class (str, optional): USPTO class (e.g., "30").
40
-
41
  Returns:
42
  dict: Contains descriptive_score, generic_score, reasons, explanation, details.
43
  """
 
19
  if "HF_HOME" not in os.environ:
20
  os.environ["HF_HOME"] = "/tmp/huggingface"
21
 
22
+ # Initialize sub-modules (models are lazy-loaded inside each class)
23
  self.linguistic = LinguisticAnalyzer(descriptive_keywords_path)
24
  self.embedding = EmbeddingSimilarity() # uses sentence-transformers
25
+ self.cross_encoder = CrossEncoderSimilarity() # uses cross-encoder
26
  self.heuristic = DescriptivenessHeuristic(
27
  self.linguistic,
28
  self.embedding,
 
32
  def analyze(self, mark, goods, goods_class=None):
33
  """
34
  Perform full descriptiveness analysis.
 
35
  Args:
36
  mark (str): The trademark text.
37
  goods (str): Description of goods/services.
38
  goods_class (str, optional): USPTO class (e.g., "30").
 
39
  Returns:
40
  dict: Contains descriptive_score, generic_score, reasons, explanation, details.
41
  """