def score_and_explain(self, project: scoring_base.ScoringProject) \ -> scoring_base.ExplainedScore: """Compute a score for the given ScoringProject.""" first_modes = project.get_fap_modes() if job_pb2.SPONTANEOUS_APPLICATION in first_modes: return scoring_base.ExplainedScore(3, [ project.translate_static_string( "c'est le canal de recrutement n°1 pour votre métier") ]) # In the category missing-diploma, we always have the alternance strategy which requires # spontaneous application data. if project.details.diagnostic.category_id == 'missing-diploma': return scoring_base.ExplainedScore(2, [ project.translate_static_string( "c'est le meilleur moyen de trouver un contrat en alternance" ) ]) second_modes = project.get_fap_modes(rank='second') if job_pb2.SPONTANEOUS_APPLICATION in second_modes: return scoring_base.ExplainedScore(2, [ project.translate_static_string( "c'est un des meilleurs canaux de recrutement pour votre métier" ) ]) if project.details.diagnostic.category_id == 'bravo' and \ user_profile_pb2.NO_OFFERS in project.user_profile.frustrations: return scoring_base.ExplainedScore(2, [ project.translate_static_string( "vous nous avez dit ne pas trouver assez d'offres.") ]) return scoring_base.NULL_EXPLAINED_SCORE
def score(self, project: scoring_base.ScoringProject) -> float: application_modes = project.job_group_info().application_modes.values() missing_fields: Set[str] = set() # User's job has no application modes info. if not application_modes: rome_id = project.details.target_job.job_group.rome_id missing_fields.add( f'data.job_group_info.{rome_id}.application_modes') raise scoring_base.NotEnoughDataException( "User's job has no application modes info. We cannot say whether this is blocking.", fields=missing_fields) user_application_mode = project.details.preferred_application_mode if not user_application_mode: missing_fields.add('projects.0.preferredApplicationMode') raise scoring_base.NotEnoughDataException( "Missing some information about user's application modes", fields=missing_fields) first_modes = project.get_fap_modes() second_modes = project.get_fap_modes(rank='second') if user_application_mode in first_modes: # User uses the correct application mode. return 0 if user_application_mode in second_modes: # User uses one of the best application modes. return 1 return 3
def score_and_explain(self, project: scoring_base.ScoringProject) \ -> scoring_base.ExplainedScore: """Compute a score for the given ScoringProject.""" if project.details.network_estimate != self._network_level: return scoring_base.NULL_EXPLAINED_SCORE first_modes = project.get_fap_modes() first_modes.discard(job_pb2.UNDEFINED_APPLICATION_MODE) if first_modes == {job_pb2.PERSONAL_OR_PROFESSIONAL_CONTACTS}: return scoring_base.ExplainedScore(3, [ 'le réseau est le canal n°1 pour trouver un métier %inDomain' ]) return scoring_base.ExplainedScore(2, [])
def score_and_explain(self, project: scoring_base.ScoringProject) \ -> scoring_base.ExplainedScore: """Compute a score for the given ScoringProject.""" first_modes = project.get_fap_modes() first_modes.discard(job_pb2.UNDEFINED_APPLICATION_MODE) if first_modes == {job_pb2.PERSONAL_OR_PROFESSIONAL_CONTACTS}: return scoring_base.ExplainedScore(2, [ project.translate_static_string( 'les embauches se font surtout par les contacts personnels ou professionnels dans' ' votre métier') ]) return scoring_base.ExplainedScore(1, [ project.translate_static_string( "c'est un bon moyen d'étendre votre réseau") ])