- 
                Notifications
    You must be signed in to change notification settings 
- Fork 31k
Adds translation pipeline #3419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds translation pipeline #3419
Conversation
b890e50    to
    132f16f      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this PR is to considered after we agree on #3413 (see my comments)
4ee18ef    to
    5fe5401      
    Compare
  
    2a256ca    to
    c0c840c      
    Compare
  
            
          
                src/transformers/pipelines.py
              
                Outdated
          
        
      | Translates from one language to another. | ||
| Usage:: | ||
| en_fr_translator = pipeline("translation", from_lng="English", to_lng="French") | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can yo update this doc string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| Codecov Report
 @@            Coverage Diff             @@
##           master    #3419      +/-   ##
==========================================
+ Coverage   77.76%   77.80%   +0.03%     
==========================================
  Files         100      100              
  Lines       16995    17025      +30     
==========================================
+ Hits        13216    13246      +30     
  Misses       3779     3779              
 Continue to review full report at Codecov. 
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
| ): | ||
| r""" | ||
| Args: | ||
| *texts: (list of strings) articles to be summarized | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
texts to be translated instead of summarized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
The API for translation is as follows:
for English to French translation.
PR adds tests and gives an example in the docstring.
PR builds on #3413 and should be merged after this one.
Example:
