Skip to content

Andalusia-Data-Science-Team/AHBS_AIServices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AIServices

installation

pip install git+https://github.com/Andalusia-Data-Science-Team/AHBS_AIServices

voice recognition

voice recorder

  1. create object from voice recorder , specify the recording folder
  • VoiceRecorder parameters
    • default_path: default_path for recording files
    • on_start_action: on record start action , method to run when the record starts
    • on record end action method to run when the record ends
from AHBS_AIServices import voice_recogntion

voice_recorder = voice_recogntion.VoiceRecorder("./recordings")
  1. you can use the voice recorder async or sync by two methods , either you control the start and end recording by space (press to talk) or you control it by start record and end record
  • record by space , you can specify the record name or leave it none to be generated:
  • you can get the recorded file path by voice_recorder.last_audio_f_pat
voice_recorder.start_record_by_keyboard()
f_path=voice_recorder.last_audio_f_path

voice recognition

simple task without abbreviation

from AHBS_AIServices import voice_recogntion
voice_recorder=voice_recogntion.VoiceRecorder("./recordings")
voice_recorder.start_record_by_keyboard()
f_path=voice_recorder.last_audio_f_path
voice_recogntion.get_text(f_path)

task with abbreviation

  • record your voice abbreviations , upload them to server , load them to server memory , use them
from AHBS_AIServices import voice_recogntion
voice_recorder=voice_recogntion.VoiceRecorder("./recordings")
voice_recorder.start_record_by_keyboard()

# first abbreviation
# load abbreviation medication
voice_recorder.start_record_by_keyboard("medication")

# upload to server
voice_recogntion.send_voice_abbreviation("./recordings/medication.wav")


voice_recorder.start_record_by_keyboard("labs")
# upload to server
voice_recogntion.send_voice_abbreviation("./recordings/labs.wav")
# or you can use path of last recorded file
voice_recogntion.send_voice_abbreviation(f_path=voice_recogntion.last_audio_f_path)


# load all abbreviations to memory
voice_recogntion.load_voice_abbreviations(['medication','labs'])

# use abbreviation by sending the abbreviation name
voice_recorder.start_record_by_keyboard()
f_path=voice_recorder.last_audio_f_path
# sending voice and abbreviation name to be used in the voice recognition
text=voice_recogntion.get_text(f_path,record_abbreviation='medication')

Translate

  • Arguments (source_file_path,output_file_path,server_ip(optional default Ai server),port (optional default 2002))

call from server

from  AHBS_AIServices import translation
translation.translate_file(file_path="test.xlsx",output_path='test_english.xlsx')

call from another pc

from  AHBS_AIServices import translation
translation.translate_file(file_path="test.xlsx",output_path='test_english.xlsx',server_ip='10.24.18.37')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages