Exemplo n.º 1
0
def post_identify_KEEL_LAID_in_text_service_norwegian_chapter():
    input_chapter_text_as_json_in_text_service_format = request.json
    title_dictionary = fetch_titles_from_text_service_input(input_chapter_text_as_json_in_text_service_format['title'],input_chapter_text_as_json_in_text_service_format['sections'])
    forward_text_transformed_to_spacy_format = transform_chapter_from_text_service_to_spacy_format(input_chapter_text_as_json_in_text_service_format)
    forward_result_with_date_in_norwegian = identify_KEEL_LAID_in_norwegian_spacy_lines(forward_text_transformed_to_spacy_format)
    forward_filtered_result_with_only_the_things_we_are_looking_for = [spacy_line for spacy_line in forward_result_with_date_in_norwegian if any("KEEL_LAID" == x['label'] for x in spacy_line['ents']) and any("DATE" == x['label'] for x in spacy_line['ents'])]
    forward_api_response = create_api_response_for_post_identify_KEEL_LAID_in_text_service_norwegian_chapter(title_dictionary,forward_filtered_result_with_only_the_things_we_are_looking_for)
    return jsonify({"identified_KEEL_LAID": forward_api_response})
Exemplo n.º 2
0
def post_identify_electrical_installation_in_text_service_norwegian_chapter_input():
    input_chapter_text_as_json_in_text_service_format = request.json
    title_dictionary = fetch_titles_from_text_service_input(input_chapter_text_as_json_in_text_service_format['title'],input_chapter_text_as_json_in_text_service_format['sections'])
    forward_text_transformed_to_spacy_format = transform_chapter_from_text_service_to_spacy_format(input_chapter_text_as_json_in_text_service_format)
    forward_result_with_electrical_installation = identify_electrical_installation_in_spacy_lines(forward_text_transformed_to_spacy_format)
    forward_filtered_result_with_only_the_things_we_are_looking_for = [spacy_line for spacy_line in forward_result_with_electrical_installation if any("VOLTAGE" == x['label'] for x in spacy_line['ents']) and any("WATER_VESSEL" == x['label'] for x in spacy_line['ents']) and any("ELECTRICAL_INSTALLATION" == x['label'] for x in spacy_line['ents'])]
    forward_api_response = create_api_response_for_post_identify_electrical_installation_in_text_service_norwegian_chapter_input(title_dictionary,forward_filtered_result_with_only_the_things_we_are_looking_for)
    return jsonify({"identified_ELECTRICAL_INSTALLATION": forward_api_response})
Exemplo n.º 3
0
def post_identify_build_date_in_text_service_english_chapter_input():
    input_chapter_text_as_json_in_text_service_format = request.json
    title_dictionary = fetch_titles_from_text_service_input(input_chapter_text_as_json_in_text_service_format['title'],input_chapter_text_as_json_in_text_service_format['sections'])
    forward_text_transformed_to_spacy_format = transform_chapter_from_text_service_to_spacy_format(input_chapter_text_as_json_in_text_service_format)
    forward_result_with_date_in_english = identify_build_date_in_english_spacy_lines(forward_text_transformed_to_spacy_format)
    forward_filtered_result_with_only_the_things_we_are_looking_for = [spacy_line for spacy_line in forward_result_with_date_in_english if any("WATER_VESSEL" == x['label'] for x in spacy_line['ents']) and any("CONSTRUCT" == x['label'] for x in spacy_line['ents']) and any("DATE" == x['label'] for x in spacy_line['ents'])]
    forward_api_response = create_api_response_for_post_identify_build_date_in_text_service_english_chapter_input(title_dictionary,forward_filtered_result_with_only_the_things_we_are_looking_for)
    return jsonify({"identified_BUILD_DATE": forward_api_response})
Exemplo n.º 4
0
def post_identify_vessel_length_overall_in_text_service_norwegian_chapter_input():
    input_chapter_text_as_json_in_text_service_format = request.json
    title_dictionary = fetch_titles_from_text_service_input(input_chapter_text_as_json_in_text_service_format['title'],input_chapter_text_as_json_in_text_service_format['sections'])
    forward_text_transformed_to_spacy_format = transform_chapter_from_text_service_to_spacy_format(input_chapter_text_as_json_in_text_service_format)
    forward_result_with_length_overall = identify_length_overall_in_spacy_lines(forward_text_transformed_to_spacy_format)
    forward_filtered_result_with_only_the_things_we_are_looking_for = [spacy_line for spacy_line in forward_result_with_length_overall if any("LENGTH" == x['label'] for x in spacy_line['ents']) and any("WATER_VESSEL" == x['label'] for x in spacy_line['ents'])]
    forward_api_response = create_api_response_for_post_identify_vessel_length_overall_in_text_service_norwegian_chapter_input(title_dictionary,forward_filtered_result_with_only_the_things_we_are_looking_for)
    return jsonify({"identified_VESSEL_LENGTH_OVERALL": forward_api_response})