mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 01:48:04 +03:00 
			
		
		
		
	Update help text and messages
This commit is contained in:
		
							parent
							
								
									af7535aca8
								
							
						
					
					
						commit
						855e3ea6c2
					
				| 
						 | 
					@ -27,7 +27,7 @@ def evaluate_cli(
 | 
				
			||||||
    gold_preproc: bool = Opt(False, "--gold-preproc", "-G", help="Use gold preprocessing"),
 | 
					    gold_preproc: bool = Opt(False, "--gold-preproc", "-G", help="Use gold preprocessing"),
 | 
				
			||||||
    displacy_path: Optional[Path] = Opt(None, "--displacy-path", "-dp", help="Directory to output rendered parses as HTML", exists=True, file_okay=False),
 | 
					    displacy_path: Optional[Path] = Opt(None, "--displacy-path", "-dp", help="Directory to output rendered parses as HTML", exists=True, file_okay=False),
 | 
				
			||||||
    displacy_limit: int = Opt(25, "--displacy-limit", "-dl", help="Limit of parses to render as HTML"),
 | 
					    displacy_limit: int = Opt(25, "--displacy-limit", "-dl", help="Limit of parses to render as HTML"),
 | 
				
			||||||
    per_component: bool = Opt(False, "--per-component", "-P", help="Return scores per component, can only be saved to output JSON file"),
 | 
					    per_component: bool = Opt(False, "--per-component", "-P", help="Return scores per component, only applicable when an output JSON file is specified."),
 | 
				
			||||||
    # fmt: on
 | 
					    # fmt: on
 | 
				
			||||||
):
 | 
					):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
| 
						 | 
					@ -84,9 +84,12 @@ def evaluate(
 | 
				
			||||||
    scores = nlp.evaluate(dev_dataset, per_component=per_component)
 | 
					    scores = nlp.evaluate(dev_dataset, per_component=per_component)
 | 
				
			||||||
    if per_component:
 | 
					    if per_component:
 | 
				
			||||||
        data = scores
 | 
					        data = scores
 | 
				
			||||||
        msg.info("Per-component scores will be saved to output JSON file.")
 | 
					 | 
				
			||||||
        if output is None:
 | 
					        if output is None:
 | 
				
			||||||
            msg.warn("No output JSON file provided for per-component scores.")
 | 
					            msg.warn(
 | 
				
			||||||
 | 
					                "The per-component option is enabled but there is no output JSON file provided to save the scores to."
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            msg.info("Per-component scores will be saved to output JSON file.")
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        metrics = {
 | 
					        metrics = {
 | 
				
			||||||
            "TOK": "token_acc",
 | 
					            "TOK": "token_acc",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user