Text Generator
Text Generator > Use Cases >Translate programming languages

Translate programming languages

To translate from one programming language to another we can use the comments to specify the source and target languages.

Example input

  • ##### Translate this function from Python into Haskell ### Python def predict_proba(X: Iterable[str]): return np.array([predict_one_probas(tweet) for tweet in X]) ### Haskell

Example real generated results

  • star

    def predictions_from_tweets( data: TweetTable ) -> (Seq[StrPrediction], Seq[TweetPredictedWithTags] ) { seq = data.words tag_id = Map( lambda x : SequenceIndexedTypeID( TypeString

  • star

    import Data.IORef as Ref def predict_proba(W: List[WRef<'String> > ) : refs = to_reflist ( W ) probas_refs = map_to_list ( get_predictions_from_w_ref, Reflists.

  • star

    Predictor p = predict_proba(X)

  • star

    import math def one_prediction_per_user( user: str, num_queries_for_predictions: Int = 50000, # about a billion tweets kNN_minimizer_params : (Double, Double), () model : Model=KNeighborsRidge

try it yourself: Text Generator Playground - Translate programming languages