Views
No views yet
python -m pip install imaginaryNLP1from imaginaryNLP.ImaginaryEmbeddingsForSequenceModeling import EvalImaginaryEmbeddingsForSequenceModeling
2
3# Load the model
4seq = EvalImaginaryEmbeddingsForSequenceModeling('Justus-Jonas/Imaginary-Embeddings-SpeakerTokens', speaker_token=True)
5
6# add candidates and context
7seq.load_candidates_from_strings(["I'm fine, thanks. How are you?", "Where did you go?", "ACL is an interesting conference"])
8
9# and context, pre-compute and keep 80% of utterances
10seq.create_context(["Hi!", 'Hey, how are you?'], precompute_top_p=0.8)
11
12seq.sequence_modeling_with_precompute("I am doing good. Today I went for a walk. ")1from imaginaryNLP.ImaginaryEmbeddingsForLTP import ImaginaryEmbeddingsForLTP
2
3ltp = ImaginaryEmbeddingsForLTP('Justus-Jonas/Imaginary-Embeddings-SpeakerTokens', speaker_token=True)
4
5# add a contex
6ltp.create_context([' Hello', 'Hi , great to meet you ! '])
7
8# add goals
9ltp.add_goal(" great to hear that ! ")
10ltp.add_goal(" Want to go for a walk ? ")
11ltp.add_goal(" Bye !")
12
13# greedy curving
14ltp.greedy_curving()
15
16# imaginary embedding chains
17ltp.imaginary_embedding_chains()
18
19# imaginary embedding chains with curving
20ltp.imaginary_embedding_chains_with_curving()