repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_semeval15_pas.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_semeval15_pas.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-01 18:26
from hanlp.components.parsers.biaffine_parser_tf import BiaffineSemanticDependencyParserTF
from hanlp.pretrained.glove import GLOVE_6B_100D
from tests import cdroot
cdroot()
save_dir = 'data/model/sdp/semeval15_biaffine_pas'
parser = BiaffineSemanticDepe... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/__init__.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/__init__.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-12-26 23:25
| python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_ctb9_pos_albert.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_ctb9_pos_albert.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 23:15
from hanlp.components.taggers.transformers.transformer_tagger_tf import TransformerTaggerTF
from tests import cdroot
cdroot()
tagger = TransformerTaggerTF()
save_dir = 'data/model/pos/ctb9_albert_base'
tagger.fit('data/pos/ctb9/train.tsv',
'da... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_ptb_pos_rnn_fasttext.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_ptb_pos_rnn_fasttext.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-10-25 21:34
import tensorflow as tf
from hanlp.components.taggers.pos_tf import RNNPartOfSpeechTaggerTF
from hanlp.pretrained.fasttext import FASTTEXT_CC_300_EN
from tests import cdroot
cdroot()
tagger = RNNPartOfSpeechTaggerTF()
save_dir = 'data/model/pos/ptb_pos... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_ptb_dep_sa_bert.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_ptb_dep_sa_bert.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-03-07 23:48
from hanlp.metrics.parsing import conllx_eval
from hanlp.datasets.parsing.ptb import PTB_SD330_DEV, PTB_SD330_TRAIN, PTB_SD330_TEST, PTB_TOKEN_MAPPING
from hanlp.components.parsers.biaffine_parser_tf import BiaffineTransformerDependencyParserTF, \
St... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_semeval15_psd.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_semeval15_psd.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-01 18:26
from hanlp.components.parsers.biaffine_parser_tf import BiaffineSemanticDependencyParserTF
from hanlp.pretrained.glove import GLOVE_6B_100D
from tests import cdroot
cdroot()
save_dir = 'data/model/sdp/semeval15_biaffine_psd'
parser = BiaffineSemanticDepe... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_conll03_ner_flair.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_conll03_ner_flair.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-10-25 21:34
import tensorflow as tf
from hanlp.components.ner.ner_tf import RNNNamedEntityRecognizerTF
from hanlp.datasets.ner.conll03 import CONLL03_EN_TRAIN, CONLL03_EN_TEST
from hanlp.pretrained.glove import GLOVE_6B_100D
from hanlp.pretrained.rnnlm import FLAIR... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_ptb_dep_biaffine_albert.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/train_ptb_dep_biaffine_albert.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-03-07 23:48
from hanlp.metrics.parsing import conllx_eval
from hanlp.datasets.parsing.ptb import PTB_SD330_DEV, PTB_SD330_TRAIN, PTB_SD330_TEST, PTB_TOKEN_MAPPING
from hanlp.components.parsers.biaffine_parser_tf import BiaffineTransformerDependencyParserTF
from test... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_msr_cws_ngram_conv_embed.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_msr_cws_ngram_conv_embed.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-21 15:39
import tensorflow as tf
from hanlp.components.tokenizers.tok import NgramConvTokenizer
from hanlp.datasets.tokenization.sighan2005.msr import SIGHAN2005_MSR_TRAIN, SIGHAN2005_MSR_VALID, SIGHAN2005_MSR_TEST
from hanlp.pretrained.word2vec import CONVSEG_W2... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_large_conv_cws.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_large_conv_cws.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-29 21:58
import tensorflow as tf
from hanlp.components.tokenizers.tok_tf import NgramConvTokenizerTF
from hanlp.datasets.cws.ctb import CTB6_CWS_TRAIN, CTB6_CWS_DEV, CTB6_CWS_TEST
from hanlp.pretrained.word2vec import CONVSEG_W2V_NEWS_TENSITE_CHAR
from tests imp... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_ctb6_cws_bert.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_ctb6_cws_bert.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 22:22
from hanlp.components.tokenizers.tok_tf import TransformerTokenizerTF
from hanlp.datasets.tokenization.ctb6 import CTB6_CWS_TRAIN, CTB6_CWS_DEV, CTB6_CWS_TEST
from tests import cdroot
cdroot()
tokenizer = TransformerTokenizerTF()
save_dir = 'data/model/... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_msr_cws_albert.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_msr_cws_albert.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 22:22
from hanlp.components.tokenizers.tok import TransformerTokenizer
from hanlp.datasets.cws.ctb import CTB6_CWS_TEST
from hanlp.datasets.tokenization.sighan2005.msr import SIGHAN2005_MSR_VALID, SIGHAN2005_MSR_TRAIN
from tests import cdroot
cdroot()
tokeniz... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_ctb6_cws_convseg.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_ctb6_cws_convseg.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 22:22
import tensorflow as tf
from hanlp.components.tokenizers.tok_tf import NgramConvTokenizerTF
from hanlp.datasets.tokenization.ctb6 import CTB6_CWS_TRAIN, CTB6_CWS_DEV, CTB6_CWS_TEST
from hanlp.pretrained.word2vec import CONVSEG_W2V_NEWS_TENSITE_CHAR
from ... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_msr_cws_bert.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_msr_cws_bert.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-21 15:39
from hanlp.components.tokenizers.tok_tf import TransformerTokenizerTF
from hanlp.datasets.tokenization.sighan2005.msr import SIGHAN2005_MSR_TRAIN, SIGHAN2005_MSR_DEV, SIGHAN2005_MSR_TEST
from tests import cdroot
cdroot()
tokenizer = TransformerTokenizerT... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_large_cws_albert.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_large_cws_albert.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 22:22
from hanlp.components.tokenizers.tok_tf import TransformerTokenizerTF
from hanlp.datasets.tokenization.ctb6 import CTB6_CWS_DEV, CTB6_CWS_TEST
from tests import cdroot
cdroot()
tokenizer = TransformerTokenizerTF()
save_dir = 'data/model/large_corpus_cws_... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_large_rnn_cws.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_large_rnn_cws.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-21 15:39
import tensorflow as tf
from hanlp.components.tokenizers.tok_tf import RNNTokenizerTF
from hanlp.datasets.cws.ctb import CTB6_CWS_TEST, CTB6_CWS_DEV
from hanlp.pretrained.word2vec import RADICAL_CHAR_EMBEDDING_100
from tests import cdroot
cdroot()
toke... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_pku980106_conv_cws.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_pku980106_conv_cws.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-21 15:39
import tensorflow as tf
from hanlp.components.tokenizers.tok_tf import NgramConvTokenizerTF
from hanlp.pretrained.word2vec import RADICAL_CHAR_EMBEDDING_100
from tests import cdroot
cdroot()
tokenizer = NgramConvTokenizerTF()
save_dir = 'data/model/cws... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_large_bert_cws.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_large_bert_cws.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-21 15:39
from hanlp.components.tokenizers.tok_tf import TransformerTokenizerTF
from hanlp.datasets.tokenization.ctb6 import CTB6_CWS_DEV, CTB6_CWS_TEST
from tests import cdroot
cdroot()
tokenizer = TransformerTokenizerTF()
save_dir = 'data/model/cws_bert_base_100... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_pku_conv_cws.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_pku_conv_cws.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-21 15:39
from hanlp.datasets.tokenization.sighan2005 import SIGHAN2005_PKU_TRAIN, SIGHAN2005_PKU_DEV, SIGHAN2005_PKU_TEST
from hanlp.pretrained.word2vec import CONVSEG_W2V_NEWS_TENSITE_CHAR
from hanlp.utils.tf_util import nice
from tests import cdroot
import tenso... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_ctb6_cws_albert.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_ctb6_cws_albert.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 22:22
from hanlp.components.tokenizers.tok_tf import TransformerTokenizerTF
from hanlp.datasets.tokenization.ctb6 import CTB6_CWS_TRAIN, CTB6_CWS_DEV, CTB6_CWS_TEST
from tests import cdroot
cdroot()
tokenizer = TransformerTokenizerTF()
save_dir = 'data/model/... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/__init__.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/__init__.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-01 20:55 | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_pku980106_rnn_cws.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_pku980106_rnn_cws.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-21 15:39
import tensorflow as tf
from hanlp.components.tokenizers.tok_tf import RNNTokenizerTF
from hanlp.pretrained.word2vec import RADICAL_CHAR_EMBEDDING_100
from tests import cdroot
cdroot()
tokenizer = RNNTokenizerTF()
save_dir = 'data/model/cws/pku_6m_rnn_... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_msr_cws_ngram_conv.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_msr_cws_ngram_conv.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-21 15:39
import tensorflow as tf
from hanlp.components.tokenizers.tok_tf import NgramConvTokenizerTF
from hanlp.datasets.tokenization.sighan2005.msr import SIGHAN2005_MSR_TRAIN, SIGHAN2005_MSR_DEV, SIGHAN2005_MSR_TEST
from hanlp.pretrained.word2vec import CONVSEG... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_large_cws_electra.py | plugins/hanlp_demo/hanlp_demo/zh/tf/train/cws/train_large_cws_electra.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 22:22
from hanlp.components.tokenizers.tok_tf import TransformerTokenizerTF
from hanlp.datasets.tokenization.ctb6 import CTB6_CWS_DEV, CTB6_CWS_TEST
from tests import cdroot
cdroot()
tokenizer = TransformerTokenizerTF()
save_dir = 'data/model/large_corpus_cws_... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/demo_dep.py | plugins/hanlp_demo/hanlp_demo/en/demo_dep.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-01 17:55
import hanlp
syntactic_parser = hanlp.load(hanlp.pretrained.dep.PTB_BIAFFINE_DEP_EN)
sent = [('Is', 'VBZ'),
('this', 'DT'),
('the', 'DT'),
('future', 'NN'),
('of', 'IN'),
('chamber', 'NN'),
('music', 'NN'),... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/demo_pos.py | plugins/hanlp_demo/hanlp_demo/en/demo_pos.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-03 22:16
import hanlp
tagger = hanlp.load(hanlp.pretrained.pos.PTB_POS_RNN_FASTTEXT_EN)
print(tagger([['I', 'banked', '2', 'dollars', 'in', 'a', 'bank', '.'],
['Is', 'this', 'the', 'future', 'of', 'chamber', 'music', '?']]))
| python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/demo_sentiment_analysis.py | plugins/hanlp_demo/hanlp_demo/en/demo_sentiment_analysis.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-01 03:52
import hanlp
classifier = hanlp.load('SST2_ALBERT_BASE_EN')
print(classifier.predict('I feel lucky'))
| python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/demo_ner.py | plugins/hanlp_demo/hanlp_demo/en/demo_ner.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-03 22:50
import hanlp
recognizer = hanlp.load(hanlp.pretrained.ner.CONLL03_NER_BERT_BASE_CASED_EN)
print(recognizer(["President", "Obama", "is", "speaking", "at", "the", "White", "House", "."]))
| python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/demo_amr.py | plugins/hanlp_demo/hanlp_demo/en/demo_amr.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2022-01-25 19:09
import hanlp
amr_parser = hanlp.load(hanlp.pretrained.amr.AMR3_SEQ2SEQ_BART_LARGE)
amr = amr_parser('The boy wants the girl to believe him.')
print(amr)
| python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/__init__.py | plugins/hanlp_demo/hanlp_demo/en/__init__.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-01 17:55 | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/demo_sdp.py | plugins/hanlp_demo/hanlp_demo/en/demo_sdp.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-03 15:26
import hanlp
from hanlp_common.conll import CoNLLSentence
# semeval15 offers three independent annotations over the Penn Treebank (PTB)
semantic_parser = hanlp.load(hanlp.pretrained.sdp.SEMEVAL15_PAS_BIAFFINE_EN)
# semantic_parser = hanlp.load(hanlp.pret... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/demo_tok.py | plugins/hanlp_demo/hanlp_demo/en/demo_tok.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-02 19:41
from hanlp.utils.lang.en.english_tokenizer import tokenize_english
text = """\
Don't go gentle into that good night.
"""
print(tokenize_english(text))
| python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/demo_lm.py | plugins/hanlp_demo/hanlp_demo/en/demo_lm.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-02-11 09:14
import hanlp
lm = hanlp.load(hanlp.pretrained.rnnlm.FLAIR_LM_FW_WMT11_EN_TF)
print(''.join(lm.generate_text(list('hello'))))
| python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/train_sst2_albert_base.py | plugins/hanlp_demo/hanlp_demo/en/train_sst2_albert_base.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-11-10 17:41
import os
from hanlp.components.classifiers.transformer_classifier_tf import TransformerClassifierTF
from tests import cdroot
from hanlp.datasets.glu.glue import STANFORD_SENTIMENT_TREEBANK_2_DEV, STANFORD_SENTIMENT_TREEBANK_2_TRAIN, \
STANFORD_SEN... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/en/demo_pipeline.py | plugins/hanlp_demo/hanlp_demo/en/demo_pipeline.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-01-04 21:05
import hanlp
from hanlp.utils.lang.en.english_tokenizer import tokenize_english
tokenizer = tokenize_english
tagger = hanlp.load(hanlp.pretrained.pos.PTB_POS_RNN_FASTTEXT_EN)
syntactic_parser = hanlp.load(hanlp.pretrained.dep.PTB_BIAFFINE_DEP_EN)
semanti... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/ja/demo_mtl.py | plugins/hanlp_demo/hanlp_demo/ja/demo_mtl.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-05-17 22:30
import hanlp
from hanlp_common.document import Document
HanLP = hanlp.load(hanlp.pretrained.mtl.NPCMJ_UD_KYOTO_TOK_POS_CON_BERT_BASE_CHAR_JA)
doc: Document = HanLP([
'2021年、HanLPv2.1は次世代の最先端多言語NLP技術を本番環境に導入します。',
'奈須きのこは1973年11月28日に千葉県円空山で生まれ、ゲーム... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/ja/__init__.py | plugins/hanlp_demo/hanlp_demo/ja/__init__.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-05-17 22:30
| python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/mul/demo_lid.py | plugins/hanlp_demo/hanlp_demo/mul/demo_lid.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2022-09-28 16:49
import hanlp
lid = hanlp.load(hanlp.pretrained.classifiers.LID_176_FASTTEXT_BASE)
print(lid('In 2021, HanLPv2.1 delivers state-of-the-art multilingual NLP techniques to production environments.'))
lang, prob = lid('2021年、HanLPv2.1は次世代の最先端多言語NLP技術を本番環境に導... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/mul/demo_mtl.py | plugins/hanlp_demo/hanlp_demo/mul/demo_mtl.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-12-31 13:51
import hanlp
from hanlp_common.document import Document
HanLP = hanlp.load(hanlp.pretrained.mtl.UD_ONTONOTES_TOK_POS_LEM_FEA_NER_SRL_DEP_SDP_CON_XLMR_BASE)
doc: Document = HanLP([
'In 2021, HanLPv2.1 delivers state-of-the-art multilingual NLP techniq... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/mul/demo_lid_restful.py | plugins/hanlp_demo/hanlp_demo/mul/demo_lid_restful.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2022-09-28 16:49
from hanlp_restful import HanLPClient
HanLP = HanLPClient('https://hanlp.hankcs.com/api', auth=None, language='mul')
print(HanLP.language_identification([
'In 2021, HanLPv2.1 delivers state-of-the-art multilingual NLP techniques to production enviro... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/mul/__init__.py | plugins/hanlp_demo/hanlp_demo/mul/__init__.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-12-31 22:25
| python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/mul/train/mul_base.py | plugins/hanlp_demo/hanlp_demo/mul/train/mul_base.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-12-03 14:24
from hanlp.common.dataset import SortingSamplerBuilder
from hanlp.common.transform import NormalizeToken
from hanlp.components.mtl.multi_task_learning import MultiTaskLearning
from hanlp.components.mtl.tasks.tok.tag_tok import TaggingTokenization
from han... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/plugins/hanlp_demo/hanlp_demo/mul/train/__init__.py | plugins/hanlp_demo/hanlp_demo/mul/train/__init__.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2023-02-21 19:40
| python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
hankcs/HanLP | https://github.com/hankcs/HanLP/blob/ddb1299bddff079e447af52ec12549c50636bfa8/docs/conf.py | docs/conf.py | # -- Project information -----------------------------------------------------
import sys
import os
from datetime import datetime
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../plugins/hanlp_common'))
sys.path.append(os.path.abspath('../plugins/hanlp_trie'))
sys.path.append(os.path.abspath(... | python | Apache-2.0 | ddb1299bddff079e447af52ec12549c50636bfa8 | 2026-01-04T14:42:01.948856Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/release.py | release.py | import os
import subprocess
import re
def get_latest_tag():
output = subprocess.check_output(['git', 'tag'])
tags = output.decode('utf-8').split('\n')[:-1]
latest_tag = sorted(tags, key=lambda t: tuple(map(int, re.match(r'v(\d+)\.(\d+)\.(\d+)', t).groups())))[-1]
return latest_tag
def update_version_n... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/tools/model_loaders/xinference_manager.py | tools/model_loaders/xinference_manager.py | import json
import os
import pandas as pd
import streamlit as st
from xinference.client import Client
import xinference.model.llm as xf_llm
from xinference.model import embedding as xf_embedding
from xinference.model import image as xf_image
from xinference.model import rerank as xf_rerank
from xinference.model import... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/tests/server_test.py | libs/python-sdk/tests/server_test.py | from open_chatcaht.chatchat_api import ChatChat
# chatchat = ChatChat()
# print(chatchat.server.get_server_configs())
# print(chatchat.server.get_prompt_template())
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/tests/chat_test.py | libs/python-sdk/tests/chat_test.py | from open_chatcaht.chatchat_api import ChatChat
# todo 之后改为标准测试
# chatchat = ChatChat()
# for data in chatchat.chat.kb_chat(query='你好', kb_name="example_kb", model='glm-4'):
# print(data)
# for data in chatchat.chat.kb_chat(query='你好', kb_name="example_kb", model='glm-4'):
# print(data)
#
# for data in chatcha... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/tests/standard_openai_test.py | libs/python-sdk/tests/standard_openai_test.py | from open_chatcaht.chatchat_api import ChatChat
from open_chatcaht.types.standard_openai.chat_input import OpenAIChatInput
#
# chatchat = ChatChat()
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/tests/装饰器声明请求_test1.py | libs/python-sdk/tests/装饰器声明请求_test1.py | import inspect
from functools import wraps
import requests
class HTTPClient:
def __init__(self, base_url='', headers=None):
self.base_url = base_url
self.headers = headers or {}
def http_request(self, method):
def decorator(url, **options):
headers = options.get('headers',... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/tests/装饰器声明请求_test.py | libs/python-sdk/tests/装饰器声明请求_test.py | from functools import wraps
from typing import Type, get_type_hints
import httpx
import requests
from pydantic import BaseModel
from open_chatcaht.api_client import ApiClient
from open_chatcaht.types.knowledge_base.delete_knowledge_base_param import DeleteKnowledgeBaseParam
from open_chatcaht.types.response.base impo... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/tests/tools_test.py | libs/python-sdk/tests/tools_test.py | from open_chatcaht.chatchat_api import ChatChat
chatchat = ChatChat()
print(chatchat.tool.list())
print(chatchat.tool.call('calculate', {"text": "3+5/2"})) | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/tests/__init__.py | libs/python-sdk/tests/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/tests/kb_test.py | libs/python-sdk/tests/kb_test.py | import logging
from open_chatcaht.chatchat_api import ChatChat
from open_chatcaht.types.knowledge_base.doc.upload_temp_docs_param import UploadTempDocsParam
# chatchat = ChatChat()
# print('create_kb', chatchat.knowledge.create_kb(knowledge_base_name="example_kb"))
# print('update_kb_info', chatchat.knowledge.update_... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/_constants.py | libs/python-sdk/open_chatcaht/_constants.py | # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Literal
import httpx
RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response"
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"
# default timeout is 10 minutes
DEFAULT_TIMEOUT = httpx.Timeout(timeout=600.0, conn... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api_client.py | libs/python-sdk/open_chatcaht/api_client.py | import contextlib
import inspect
import json
import logging
import os
from typing import *
from open_chatcaht._constants import API_BASE_URI
from open_chatcaht.utils import set_httpx_config, get_httpx_client, get_variable, get_function_default_params, \
merge_dicts
from functools import wraps
from typing import Ty... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/chatchat_api.py | libs/python-sdk/open_chatcaht/chatchat_api.py | import logging
from open_chatcaht._constants import API_BASE_URI
from open_chatcaht.api.chat.chat_client import ChatClient
from open_chatcaht.api.knowledge_base.knowledge_base_client import KbClient
from open_chatcaht.api.server.server_client import ServerClient
from open_chatcaht.api.standard_openai.standard_openai_c... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/exceptions.py | libs/python-sdk/open_chatcaht/exceptions.py | from __future__ import annotations
from open_chatcaht.utils import is_dict
from typing import Any, Optional, cast
from typing_extensions import Literal
import httpx
__all__ = [
"BadRequestError",
"AuthenticationError",
"PermissionDeniedError",
"NotFoundError",
"ConflictError",
"UnprocessableE... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/version.py | libs/python-sdk/open_chatcaht/version.py | from ._version import __version__
VERSION: str = __version__
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/_version.py | libs/python-sdk/open_chatcaht/_version.py |
__title__ = "open_chatcaht"
__version__ = "1.35.13"
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/utils.py | libs/python-sdk/open_chatcaht/utils.py | import base64
import inspect
import os
from io import BytesIO
from pathlib import Path
from typing import Union, List, Dict
import httpx
from pydantic import BaseModel
from typing_extensions import TypeGuard
from open_chatcaht._constants import HTTPX_TIMEOUT
def get_httpx_client(
use_async: bool = False,
... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/__init__.py | libs/python-sdk/open_chatcaht/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/extra/__init__.py | libs/python-sdk/open_chatcaht/extra/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/extra/llmaindex/chatchat_kb_retrieve.py | libs/python-sdk/open_chatcaht/extra/llmaindex/chatchat_kb_retrieve.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/extra/llmaindex/__init__.py | libs/python-sdk/open_chatcaht/extra/llmaindex/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/extra/langchain/chatchat_kb_retrieve.py | libs/python-sdk/open_chatcaht/extra/langchain/chatchat_kb_retrieve.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/extra/langchain/__init__.py | libs/python-sdk/open_chatcaht/extra/langchain/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/__init__.py | libs/python-sdk/open_chatcaht/api/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/chat/chat_client.py | libs/python-sdk/open_chatcaht/api/chat/chat_client.py | from typing import Optional, List, Literal, Union
from pydantic import Field
from open_chatcaht._constants import MAX_TOKENS, LLM_MODEL, TEMPERATURE, SCORE_THRESHOLD, VECTOR_SEARCH_TOP_K
from open_chatcaht.api_client import ApiClient
from open_chatcaht.types.chat.chat_feedback_param import ChatFeedbackParam
from open... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/chat/__init__.py | libs/python-sdk/open_chatcaht/api/chat/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/tools/tool_client.py | libs/python-sdk/open_chatcaht/api/tools/tool_client.py | from open_chatcaht.api_client import ApiClient
from open_chatcaht.types.tools.call_tool_param import CallToolParam
API_URI_TOOL_CALL = "/tools/call"
API_URI_TOOL_LIST = "/tools"
class ToolClient(ApiClient):
def list(self) -> dict:
"""
列出所有工具
"""
resp = self._get(API_URI_TOOL_LIST)... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/tools/__init__.py | libs/python-sdk/open_chatcaht/api/tools/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/standard_openai/standard_openai_client.py | libs/python-sdk/open_chatcaht/api/standard_openai/standard_openai_client.py | from typing import Dict, List
from open_chatcaht.api_client import ApiClient, get
from open_chatcaht.types.standard_openai.audio_speech_input import OpenAIAudioSpeechInput
from open_chatcaht.types.standard_openai.audio_transcriptions_input import OpenAIAudioTranscriptionsInput
from open_chatcaht.types.standard_openai.... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/standard_openai/__init__.py | libs/python-sdk/open_chatcaht/api/standard_openai/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/knowledge_base/knowledge_base_client.py | libs/python-sdk/open_chatcaht/api/knowledge_base/knowledge_base_client.py | from pydantic import Field
from open_chatcaht._constants import EMBEDDING_MODEL, VS_TYPE, VECTOR_SEARCH_TOP_K, SCORE_THRESHOLD, CHUNK_SIZE, \
OVERLAP_SIZE, ZH_TITLE_ENHANCE, LLM_MODEL
from open_chatcaht.api_client import ApiClient, post
from open_chatcaht.types.knowledge_base.create_knowledge_base_param import Cre... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/knowledge_base/__init__.py | libs/python-sdk/open_chatcaht/api/knowledge_base/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/server/server_client.py | libs/python-sdk/open_chatcaht/api/server/server_client.py | from open_chatcaht.api_client import ApiClient
API_URI_GET_SERVER_CONFIGS = "/server/configs"
API_URI_GET_PROMPT_TEMPLATE = "/server/get_prompt_template"
class ServerClient(ApiClient):
# 服务器信息
def get_server_configs(self) -> dict:
response = self._post(API_URI_GET_SERVER_CONFIGS)
return self.... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/api/server/__init__.py | libs/python-sdk/open_chatcaht/api/server/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/chat/kb_chat_param.py | libs/python-sdk/open_chatcaht/types/chat/kb_chat_param.py | from typing import Optional, List, Literal
from pydantic import BaseModel, Field
from open_chatcaht._constants import MAX_TOKENS, TEMPERATURE, SCORE_THRESHOLD, VECTOR_SEARCH_TOP_K, LLM_MODEL
from open_chatcaht.types.chat.chat_message import ChatMessage
class KbChatParam(BaseModel):
query: str = Field(..., descr... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/chat/file_chat_param.py | libs/python-sdk/open_chatcaht/types/chat/file_chat_param.py | from typing import Optional, List
from pydantic import BaseModel, Field
from open_chatcaht._constants import VECTOR_SEARCH_TOP_K, SCORE_THRESHOLD
from open_chatcaht.types.chat.chat_message import ChatMessage
class FileChatParam(BaseModel):
"""文件对话类"""
query: str = Field(..., description="用户输入", examples=["... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/chat/chat_message.py | libs/python-sdk/open_chatcaht/types/chat/chat_message.py | from pydantic import BaseModel, Field
class ChatMessage(BaseModel):
role: str = Field(...)
content: str = Field(...)
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/chat/__init__.py | libs/python-sdk/open_chatcaht/types/chat/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/chat/chat_feedback_param.py | libs/python-sdk/open_chatcaht/types/chat/chat_feedback_param.py | from pydantic import Field, BaseModel
class ChatFeedbackParam(BaseModel):
message_id: str = Field("", max_length=32, description="聊天记录id"),
score: int = Field(0, max=100, description="用户评分,满分100,越大表示评价越高"),
reason: str = Field("", description="用户评分理由,比如不符合事实等"),
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/chat/chat_completions.py | libs/python-sdk/open_chatcaht/types/chat/chat_completions.py | from chatchat.server.api.api_schemas import OpenAIChatInput
class ChatCompletions(OpenAIChatInput):
...
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/tools/call_tool_param.py | libs/python-sdk/open_chatcaht/types/tools/call_tool_param.py | from pydantic import Field, BaseModel
class CallToolParam(BaseModel):
name: str = Field(..., description="工具名称")
tool_input: dict = Field({}, description="知识库信息"),
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/tools/__init__.py | libs/python-sdk/open_chatcaht/types/tools/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/embeddings_Input.py | libs/python-sdk/open_chatcaht/types/standard_openai/embeddings_Input.py | from typing import Union, List, Optional, Literal
from open_chatcaht.types.standard_openai.base import OpenAIBaseInput
class OpenAIEmbeddingsInput(OpenAIBaseInput):
input: Union[str, List[str]]
model: str
dimensions: Optional[int] = None
encoding_format: Optional[Literal["float", "base64"]] = None
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/audio_transcriptions_input.py | libs/python-sdk/open_chatcaht/types/standard_openai/audio_transcriptions_input.py | from typing import Optional, List, Literal
from open_chatcaht.types.standard_openai.audio_translations_input import OpenAIAudioTranslationsInput
class OpenAIAudioTranscriptionsInput(OpenAIAudioTranslationsInput):
language: Optional[str] = None
timestamp_granularities: Optional[List[Literal["word", "segment"]... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/audio_speech_input.py | libs/python-sdk/open_chatcaht/types/standard_openai/audio_speech_input.py | from typing import Optional, Literal
from open_chatcaht.types.standard_openai.base import OpenAIBaseInput
class OpenAIAudioSpeechInput(OpenAIBaseInput):
input: str
model: str
voice: str
response_format: Optional[
Literal["mp3", "opus", "aac", "flac", "pcm", "wav"]
] = None
speed: Opti... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/audio_translations_input.py | libs/python-sdk/open_chatcaht/types/standard_openai/audio_translations_input.py | from typing import Union, Optional, Any
from pydantic import AnyUrl
from open_chatcaht._constants import TEMPERATURE
from open_chatcaht.types.standard_openai.base import OpenAIBaseInput
class OpenAIAudioTranslationsInput(OpenAIBaseInput):
file: Union[Any, AnyUrl]
model: str
prompt: Optional[str] = None
... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/image_generations_input.py | libs/python-sdk/open_chatcaht/types/standard_openai/image_generations_input.py | from typing import Literal, Optional
from open_chatcaht.types.standard_openai.image_base_input import OpenAIImageBaseInput
class OpenAIImageGenerationsInput(OpenAIImageBaseInput):
prompt: str
quality: Literal["standard", "hd"] = None
style: Optional[Literal["vivid", "natural"]] = None | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/image_base_input.py | libs/python-sdk/open_chatcaht/types/standard_openai/image_base_input.py | from typing import Optional, Literal
from open_chatcaht.types.standard_openai.base import OpenAIBaseInput
class OpenAIImageBaseInput(OpenAIBaseInput):
model: str
n: int = 1
response_format: Optional[Literal["url", "b64_json"]] = None
size: Optional[
Literal["256x256", "512x512", "1024x1024", ... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/image_edits_input.py | libs/python-sdk/open_chatcaht/types/standard_openai/image_edits_input.py | from typing import Any, Union
from pydantic import AnyUrl
from open_chatcaht.types.standard_openai.image_variations_input import OpenAIImageVariationsInput
class OpenAIImageEditsInput(OpenAIImageVariationsInput):
prompt: str
mask: Union[Any, AnyUrl] | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/image_variations_input.py | libs/python-sdk/open_chatcaht/types/standard_openai/image_variations_input.py | from typing import Union, Any
from pydantic import AnyUrl
from open_chatcaht.types.standard_openai.image_base_input import OpenAIImageBaseInput
class OpenAIImageVariationsInput(OpenAIImageBaseInput):
image: Union[Any, AnyUrl]
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/chat_input.py | libs/python-sdk/open_chatcaht/types/standard_openai/chat_input.py | from typing import List, Optional, Dict, Union
from open_chatcaht._constants import LLM_MODEL, TEMPERATURE
from open_chatcaht.types.standard_openai.base import OpenAIBaseInput
from openai.types.chat import (
ChatCompletionMessageParam,
ChatCompletionToolChoiceOptionParam,
ChatCompletionToolParam,
compl... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/__init__.py | libs/python-sdk/open_chatcaht/types/standard_openai/__init__.py | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false | |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/standard_openai/base.py | libs/python-sdk/open_chatcaht/types/standard_openai/base.py | from typing import Optional, Dict
from pydantic import BaseModel, Field
class OpenAIBaseInput(BaseModel):
user: Optional[str] = None
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over valu... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/knowledge_base.py | libs/python-sdk/open_chatcaht/types/knowledge_base/knowledge_base.py | from typing import Optional
from pydantic import BaseModel, Field
from datetime import datetime
class KnowledgeBaseInfo(BaseModel):
id: int = Field(default=None, description="知识库id")
kb_name: str = Field(default=None, description="知识库名称")
kb_info: Optional[str] = Field(default=None, description="知识库信息... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/delete_knowledge_base_param.py | libs/python-sdk/open_chatcaht/types/knowledge_base/delete_knowledge_base_param.py | from pydantic import Field, BaseModel
class DeleteKnowledgeBaseParam(BaseModel):
knowledge_base_name: str = Field(..., description="知识库名称")
| python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
chatchat-space/Langchain-Chatchat | https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/create_knowledge_base_param.py | libs/python-sdk/open_chatcaht/types/knowledge_base/create_knowledge_base_param.py | from typing import Optional
from pydantic import Field, BaseModel
class CreateKnowledgeBaseParam(BaseModel):
knowledge_base_name: str = Field(default=None, description="知识库名称")
vector_store_type: str = Field(default=None, description="向量存储类型")
kb_info: Optional[str] = Field(default=None, description="知识库... | python | Apache-2.0 | 49165d6af4438aa7e8a1f71ce276db55f4405151 | 2026-01-04T14:41:43.908377Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.