@Shwetha V I believe this is an expected result as per the design or model behind the API. The special character _
is normally not used to distinguish/sperate words in a sentence or a document because these can be a email address with _
that would not need any translation. If a comma(,) is used the words will be translated. You can lookup the same with the translate API directly.
I would recommend to pre-process documents that contain such words to replace them with a comma to ensure the translated document is accurate in the target language.
If an answer is helpful, please click on or upvote
which might help other community members reading this thread.