Saravanan666/pypi-org huggingface dataset:
Package: chparse
chparse - Parse Clone Hero charts with ease!InstallationInstall the stable build via:pip install chparseOr install the latest development (unstable) build via:git clone https://github.com/Kenny2github/chparse.git
cd chparse
python setup.py installExample UsageAssuming your .chart file is named “notes.chart”…>>>importchparse>>>withopen('notes.chart')aschartfile:...chart=chparse.load(chartfile)>>>chart.instruments[chparse.EXPERT][chparse.GUITAR][0]<Note:0=N30(<Flags.NONE:0>)>
Package: chpass
chpassGather information from Chrome 🔑Featuresimport/export passwordshistorygoogle account profile picturedownloadstop visited sitesInstalling$pipinstallchpassUsageusage: chpass [-h] [-u USER] [-i FILE_ADAPTER] {import,export} ...Chrome must be closed during the whole process, because its database is locked while running.Exportusage: chpass export [-h] [-d DESTINATION_FOLDER] {passwords,history,downloads,top_sites,profile_pic} ...Importusage: chpass import [-h] -f FROM_FILEIn order to import the passwords successfully, Chrome must be restarted after the import to load the passwords from the database.File adapterschpasssupport read/write functionality withcsvandjson.the default export and import is done withcsv.you can change the file adapter with the flag:$chpass-ijsonexportLicenseThis project is licensed under the terms of the MIT license.
Package: chpip
chpipA tool to manage the base URL of the Python package index.Installation$pipinstallchpipUsageSet pip index URLSet the base URL of the Python package index with name.$chpipset-nustc-ihttps://mirrors.ustc.edu.cn/pypi/web/simpleFor more information about the options, please refer to thechpip setcommand.$chpipset--help
Usage:chpipset[OPTIONS]Options:-n,--nameTEXTNameofthePythonpackageindex.[required]-i,--index-urlTEXTBaseURLofthePythonPackageIndex.ThisshouldpointtoarepositorycompliantwithPEP503(thesimplerepositoryAPI)oralocaldirectorylaidoutinthesameformat.[required]--helpShowthismessageandexit.Change pip index URLChange the base URL of the Python package index without name which means switching between the two indexes in turn.$chpip
ChangePythonpackageindexto`ustc`successful.
$chpip
ChangePythonpackageindexto`default`successful.Change the base URL of the Python package index with name.$chpip-nustc
ChangePythonpackageindexto`ustc`successful.Show pip index URLsShow all base URLs of the Python package index. Current index is marked with*.$chpipshowdefault(https://pypi.org/simple)*ustc(https://mirrors.ustc.edu.cn/pypi/web/simple)List commonly used pip index URLsList the commonly used URLs of the Python package index, which can be set by executing thechpip setcommand.$chpiplistaliyun(https://mirrors.aliyun.com/pypi/simple)douban(https://pypi.doubanio.com/simple)netease(https://mirrors.163.com/pypi/simple)pypi(https://pypi.org/simple)tencent(https://mirrors.cloud.tencent.com/pypi/simple)tsinghua(https://pypi.tuna.tsinghua.edu.cn/simple)ustc(http://pypi.mirrors.ustc.edu.cn/simple)
Package: chpronounce
Ch-PronounceA tool that usespkuseg, a text segmentation tool,  and dictionaries to convert Chinese sentences to zhuyin (a.k.a. bopomofo) or pinyinUsagefromchpronounceimportChPronouncechp=ChPronounce()# To print out segmentation result from pkuseg, use:# chp = ChPronounce(print_seg=True)# Convert to both pinyin and zhuyinprint(chp.get_duyin("吃飽了沒？"))# Convert to zhuyinprint(chp.get_zhuyin("吃飽了"))# Convert to pinyinprint(chp.get_pinyin("我能吃玻璃而不傷身體"))print(chp.get_duyin("我睡著了"))# Output:# [('chi', 'ㄔ', 1), ('bao', 'ㄅㄠ', 3), ('le', 'ㄌㄜ', 5), ('mei', 'ㄇㄟ', 2), ('？', '？', 0)]# [('ㄔ', 1), ('ㄅㄠ', 3), ('ㄌㄜ', 5)]# [('wo', 3), ('neng', 2), ('chi', 1), ('bo', 1), ('li', 5), ('er', 2), ('bu', 4), ('shang', 1), ('shen', 1), ('ti', 3)]# [('wo', 'ㄨㄛ', 3), ('shui', 'ㄕㄨㄟ', 4), ('zhao', 'ㄓㄠ', 2), ('le', 'ㄌㄜ', 5)]Edit dictionaryfromchpronounceimportChPronounceChPronounce().inspect_dict()Toaccessormodifydictionary,use'dic'Tosave,usesave()Python3.7.7(default,Apr242020,09:08:39)[GCC9.3.0]onlinuxType"help","copyright","credits"or"license"formoreinformation.(InteractiveConsole)>>>dic[1]["好"]# Check the word "好"[(('hao','ㄏㄠ',3),'形副助叹动'),(('hao','ㄏㄠ',4),'动名')]>>>dic[1]["好"]=[(('hao','ㄏㄠ',3),'形副助叹动')]# Modify the word>>>dic[2]["你好"]# Check a phrase(['ni','hao'],['ㄋㄧ','ㄏㄠ'],[3,3])>>>dic[3]["好棒棒"]=(['hao','bang','bang'],['ㄏㄠ','ㄅㄤ','ㄅㄤ'],[3,4,4])# Create a phrase>>>save()# Write changesPressCtrl+Dto exit the shellDictionary structure:dic├──1:(dict)│├──"數":[(list)││(('shu','ㄕㄨ',4),'名形'),││(('shu','ㄕㄨ',3),'动副')││]│├──...│├──2:(dict)│├──"你好":(['ni','hao'],['ㄋㄧ','ㄏㄠ'],[3,3])│├──...│├──3:(dict)│├──"計算機":(['ji','suan','ji'],['ㄐㄧ','ㄙㄨㄢ','ㄐㄧ'],[4,4,1])│├──...│├──4:...├──...dic=["",{"X":[(...),(...)]},{"XX":(...),"YY":(...)}]ReferencesDictionaryzdic.netmoedict.twText segmentation toolpkusegChinese Traditional to Simplified conversionOpenCC
Package: chp-sim
Python CHP Stabilizer SimulatorA simple reference python implementation of Scott Aaronson and Daniel Gottesman’s CHP simulator
as defined intheir 2004 paper “Improved Simulation of Stabilizer Circuits”.
This simulator is capable of simulating quantum stabilizer circuits in polynomial time and space.
Specifically, it usesO(q^2*m + q*c)time andO(q^2)space whereqis the number of qubits,mis the number of measurements,
andcis the number of Hadamard/CNOT/Phase gates.InstallationThechp_simpackage is available on pypi and can be installed usingpip:python-mpipinstallchp_simAlternatively, you can just copy paste thechp_simdirectory of the github
repository into your project.
The only runtime dependency isnumpy.UsageHere is an example of simulatinga circuit:importchp_simsim=chp_sim.ChpSimulator(num_qubits=3)# Desired circuit:# 0: -------X-------S---H---M---#           |# 1: -------|---X---S---H---M---#           |   |# 2: ---H---@---@-------H---M---sim.hadamard(2)sim.cnot(2,0)sim.cnot(2,1)sim.phase(0)sim.phase(1)sim.hadamard(0)sim.hadamard(1)sim.hadamard(2)# Show internal simulator state.print(sim,'\n')# prints:#   -Y..#   -.Y.#   +..X#   ----#   +X.X#   +.XX#   +YYZ# Perform measurementsv0=sim.measure(0)v1=sim.measure(1)v2=sim.measure(2)print(v0)print(v1)print(v2)# prints [note: one of four possible results for this circuit]:#   True (random)#   False (random)#   False (determined)# Check pattern the outputs should satisfy.assertnotv0.determinedassertnotv1.determinedassertv2.determinedassertbool(v0)^bool(v1)^bool(v2)Packaging(Notes to self on how to release a new version.)Edit the source code as needed and run tests.pytestBuild the wheel.python3setup.py-qbdist_wheellsdistUpload to test pypi.twineuploaddist/*.whl--repository-url=https://test.pypi.org/legacy/--username="${TEST_TWINE_USERNAME}"--password="${TEST_TWINE_PASSWORD}"Verify the test package works.mkvirtualenvtest--python=/usr/bin/python3pipinstallnumpypipinstallchp_sim--index-url=https://test.pypi.org/simple/python-c"import chp_sim; print(chp_sim.__version__); print(chp_sim.ChpSimulator(4))"Upload to prod pypi.twineuploaddist/*.whl--username="${PROD_TWINE_USERNAME}"--password="${PROD_TWINE_PASSWORD}"Verify the prod package works.mkvirtualenvtest--python=/usr/bin/python3pipinstallchp_simpython-c"import chp_sim; print(chp_sim.__version__); print(chp_sim.ChpSimulator(4))"
Package: chptools
# A series of Chinese processing toolsThere are some features in the package. If you need to use it can be installed directlyextract_chinese(self, text, symbols= “”, remove_letter=False)Extract chinese from raw text. You can choose symbols to replace non-Chinese characters in the corpusfilter_words_in_corups(self, sensitive_list, raw_text_list)Use AC automata to filter sensitive wordsis_chinese(self, uchar)Determine if a character is Chineseget_json_data(self, path)Read json data from a file, where each line is a Dictsave_data_to_npy(self, data, path)read_data_from_npy(self, path)
Package: chpwd-cmd
chpwd_cmdWhat is this?chpwd_cmd executes the commands in the configuration file according to the
current working directory. It is intended to be called from the hook function of zsh, fish and so on. With this you will no longer need to type a command every time you move the directory.How to installpip install chpwd-cmdConfigurationchpwd_cmd requires configuration file at runtime. Configuration file must be located$HOME/.chpwd_cmd. Configuration File is written in Toml format.Configuration is written in everyworkdir.nametable. If you write more than oneworkdir.name, the name must be unique.Configuration ItemnametypedescriptionrequireddirpathstringSpecifies the directory of execution. The specification of the directory can be written using the glob pattern. If the directory path is the same as the other Workdir Both commands work.TruecmdstringSpecifies the command to executeTrueExample of configuration file[workdir.home]
dirpath = "/Users/hoge"
cmd = "ls"

[workdir.git]
dirpath = "~/Documents/git/*/*"
cmd = "git fetch -p"How to useusage: chpwd_cmd [-h] [-c CWD] [-m {exec,dryrun,listdir}]

This program executes the commands in the configuration file according to the
current working directory

optional arguments:
  -h, --help            show this help message and exit
  -c CWD, --cwd CWD     current working directory
  -m {exec,dryrun,listdir}, --mode {exec,dryrun,listdir}
                        running mode (default:exec)ExecutionIf you specify a directory path inexecmode, chpwd_cmd execute it. The default mode of chpwd_cmd isexec.chpwd_cmd -m exec -c $HOMEIf you are using zsh, you will be able to call it as follows.Adding to your .zshrc file.function chpwd() {
  chpwd_cmd -c $PWD
}If you are using fish, you will be able to call it as follows.Adding to your ~/.config/fish/config.fish file.function chpwd --on-variable PWD
  chpwd_cmd -c $PWD
endDryrunIt is recommended to do adryrunbefore running the modeexec.
You can check if a directory is targeted for execution by doing dryrun.chpwd_cmd -m dryrun -c $HOMEList DirectoryYou can list the directories for execution. It is useful if you specify the directory path as a wildcard.chpwd_cmd -m listdirHow to testmake testLicenseMIT LicenseAuthor:teddy@sfc.wide.ad.jp
Package: chr
chr(coded under the namechru) is a Python based URL shortening service which uses Flask as a front end, and pysqlw as the SQL backend, to interface with sqlite3.It can shrink billions of unique URLs with less than 6 characters, run in the background with no human interaction, and it can fly like a bird – or is that Super Man?FeaturesCan shorten several billion (yes!) unique urls to a less than 6 character slug.Verifies the shrunk URLs are legitimate, to stop abuse.Uses reCAPTCHA to stop spammers from using the service for evil, not good.Slugs are the base62 representation of their ID, so they’ll work in all browsers.A live chr instance is located atchr.so.DependenciesPython 27(>=2.7required because of use ofargparsemodule)requests(python-requests)Flask(flask)Flask KVSession(flask-kvsession)recaptcha client(recaptcha-client)mattdaemon(mattdaemon>=1.1.0)pysqlw(pysqlw>=1.3.0)To install all of these:pip-rrequirements.txt install(if installing from source)NotesIt’shighlyrecommended by the chr developers that if you’re putting this in a production environment (read:any computer with a public IP) that you look at the variousFlask deploymentoptions, such as putting it behind nginx, lighttpd, or something.It’s also recommended that you get your server (nginx, lighttpd, or hell, even Apache) serve out the static folder, rather than letting Flask do it.This will take a while to get fully featured, but we have a lot planned.jqPlotcomes bundled with chr, which is alright as it’s MIT licensed.RunningVisit thedocspage, and clickUsagefor information on how to run chr.AuthorplausibilityContributorshueyChris Leonello(made jqPlot)
Package: chreader
chreader中文自然语言处理数据集工具包优秀特性易用支持自动下载和缓存，一行命令即可获得指定数据集支持命令行的方式展示已有数据集及其详细描述无缝衔接allennlp、catalyst、pytorch_lightning、FARM等常用 NLP 框架丰富，支持分类、生成、标注等多种类型数据集，共计2种灵活可以自由添加自定义数据集，只需继承ChDatasetReader即可借助allennlp可使用各种tokenizer、token_indexer、vocab等组件，并对其进行高级配置安装gitgitclonehttps://github.com/wangyuxinwhy/chreader.git
pipinstall-e.pippipinstall-Uchreader使用构建Dataset&DataLoaderfromchreaderimportload_dataset,DataLoadertrain_dataset=load_dataset("tnews","train")dev_dataset=load_dataset("tnews","dev")train_dataloader=DataLoader(train_dataset,batch_size=32)dev_dataloader=DataLoader(dev_dataset,batch_size=32)fordataintrain_dataloader:...命令行//列出所有可用数据集
chreaderlist//展示数据集详细信息
chreadershowtnewsTODO添加更多数据集添加 dataset_type 字段，现在只有classification一种classificationsentimentgenerationsummarizationtaggingnerdependency_parsing支持外部的配置美化命令行的输出录一个 gif添加 docs添加 tutorial
Package: chrhyme
中文押韵器 Chinese Rhymer一、简介这是一款帮助诗歌爱好者和说唱爱好者寻找押韵灵感的小工具。只要输入一个目标词，和一些限制条件，该工具就能查询词库中所有满足条件的押韵词。目前提供单押，双押，三押和四押查询功能， 同时支持俗语、科技术语等词长扩展押韵。二、安装系统要求：Python 2 或 3。$ pip install chrhyme三、使用1、要求该工具根据《汉语拼音方案》对输入词的声母和韵母进行预处理。输入词长度要求为1-4，任何在该长度以下或以上的输入词视为不合法。该工具会自动去除输入词汉字以外的任何元素。2、功能：用例：长江 (cháng jiāng)声母组合：(ch, j)全韵母组合：(ang, iang)半韵母组合：(ang, ang)声调组合：目前不支持声调押韵。默认情况下，为得到最大匹配效果，该工具按照半韵母组合进行查找。条件设置声母押韵：输入想要押相同声母的字的位置，从左数起，1 为长, 2 为江，12 为长江，顺序任意。任何大于 2 的数字都被视为 2。如果不押声母，输入0。全韵母押韵：输入想要押全韵母的字的位置，从左数起，1 为长, 2 为江，12 为长江，顺序任意。任何大于 2 的数字都被视为 2。如果不押全韵母，输入0。3、命令行$ chrhyme然后，请根据命令行提示进行操作。运行样例如下：四、版本更新v0.2.6(06/17/2018)1、修正在Windows系统上打开数据文件出错的问题。v0.2.5(05/11/2018)1、开放单押功能2、支持扩展押韵，如输入词为报恩，可以查询到一朝天子一朝臣，即长度扩展的匹配词尾部与输入词押韵。3、区分si(思),shi(诗),ji(机)三类不同发音的i4、扩大词库 (70万细胞词)5、兼容Python 2 和 3 所有版本v0.1.5(05/04/2018)1、区分发音不同的an和ian，以及e和iev0.1.0(05/03/2018)1、开放双押、三押和四押功能2、支持声母及全韵母押韵五、相关项目本项目使用的汉字转拼音系统来自：汉字拼音转换工具 (Python版)。
Package: chris-parser
chris-parserchris-parser is a Python library for parsing .chris files.InstallationUse the package managerpipto install foobar.pipinstallchris-parserUsageimportchrischris.parse('my_file.chris')# returns a Chris object with various useful attributesContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseGNU GPLv3
Package: chris-plugin
PythonChRISPlugin SupportChRISis a platform for scientific and medical applications.https://chrisproject.org/This repository provideschris_plugin, a Python utility library
for writing programs in Python which can run onChRIS.Getting StartedHave an existing Python program? SeeHOW TO: Convert an existing Python appinto aChRISdsplugin.If you're creating anewprogram,
you can start from this template:https://github.com/FNNDSC/python-chrisapp-templateExamples can be found in./examples.UsageAfter developing a plugin, use the commandchris_plugin_infoto produce a JSON description of yourChRISplugin.chris_plugin_info--dock-image{registry}/{repo}/{name}:{version}[module_name]Ifmodule_nameis not given, thenchris_plugin_infowill automatically discover yourChRISplugin.Development Goalschris_pluginstrives to have zero-dependencies and compatible with Python 3.8 through 3.12.
Package: christmas-tree
Christmas treeThis tool will launch christmas tree right in your terminal, use it just for fun :)Toolspython 3.6, 3.7, 3.8blackpylintpytestUsagePlease run following script to obtain latest package from PYPI:➜pipinstallchristmas-treeThen please execute instructions below to launch game from your environment:fromchristmas.treeimportTree,ChristmasTreetree:Tree=ChristmasTree(name="awesome",type_to="real")tree.launch(speed=.2)Development notesLaunch source codeTo be able to run source code please execute command below:➜python-mchristmas-h
➜python-mchristmastreeawesomereal.2CIProject has Travis CI integration thus code analysis (black,pylint) and unittests (pytest) will be run automatically
after every made change to the repository.To be able to run code analysis, please execute command below:➜./run-code-analysis.shRelease notes0.3.0Introduce christmas tree package0.2.1Apply code analysis0.2.0Add PYPI package0.1.0Introduce initial app versionMetaAuthor – Volodymyr YahelloDistributed under theMITlicense. SeeLICENSEfor more information.You can reach out me at:vyahello@gmail.comhttps://github.com/vyahellohttps://www.linkedin.com/in/volodymyr-yahello-821746127Contributingclone the repositoryconfigure Git for the first time after cloning with yournameandemailpip install -r requirements.txtto install all project dependenciespip install -r requirements-dev.txtto install all development project dependencies
Package: chrofile
参考PyPIパッケージのリリースもバージョニングもGitHub単独で完結させるhttps://zenn.dev/detsu/articles/5d74bf72e96a0fHow can I infinite-scroll a web page using selenium webdriver in pythonhttps://stackoverflow.com/questions/70906433/how-can-i-infinite-scroll-a-web-page-using-selenium-webdriver-in-pythonChrofileGet a list of user profiles for the chrome browser.installationpip install chrofileusagefrom time import sleep
import chrofile

def main():
  driver = None
  try:
    chrome = chrofile.start()
    sleep(30)
    ### some browser controls ###
  except Exception as e:
    print(e)
  finally:
    if chrome: chrome.quit()

main()Referencehttps://mikebird28.hatenablog.jp/entry/2020/06/15/233447Upload PyPIpip install pip install setuptools wheel twine
rm -rf build dist chrofile.egg-info

python setup.py sdist && python setup.py bdist_wheel && python -m twine upload --repository pypi dist/*
Package: chroma-craft
ChromaCraftChromaCraft is a Python package for generating and visualizing distinguishable color palettes. It provides tools for generating color sets with specific criteria, such as minimum and maximum color differences. This package is particularly useful for data visualization and design tasks where a set of visually distinct colors is needed.InstallationTo install you can simply usepippipinstallchroma-craft´´UsageImport the ChromaCraft package and use its functions to generate and visualize color palettes.importchroma_craftasccimportseabornassns# Set the Seaborn style for better visualizationsns.set_style('whitegrid')# Generate a list of distinguishable colorsn=24# Number of colors to generatemin_color_diff=0.25# Minimum color differencemax_color_diff=1.2# Maximum color differencecolors=cc.generate_distinguishable_colors(n,min_color_diff,max_color_diff,hexa=True)# Plot the color palettecc.plot_color_palette(colors)print(colors)['#c6dd6d','#51e3fb','#6c8c98','#80f79e','#cd4e76','#09fe8a','#2e3c0c','#17229b','#d6c1b1','#82a243','#843520','#7a039f','#21a371','#d4c00d','#7c90dd','#537e02','#66495e','#342147','#ef7b43','#b90d76','#c39b7e','#8adf15','#1556cc','#3bde54']DebugHere's an example of how debug information is shown:importchroma_craftasccimportseabornassns# Set the Seaborn style for better visualizationsns.set_style('whitegrid')# Number of colors to generaten=3# Minimum and maximum color differencemin_color_diff=0.25max_color_diff=1.2# Generate a list of distinguishable colorscolors=cc.generate_distinguishable_colors(n,min_color_diff,max_color_diff,debug=True,hexa=False)# Plot the color palettecc.plot_color_palette(colors)AuthorChromaCraft was created by Felix. If you find this package useful or have any feedback, please feel free to reach out tocroma_craft@auneria.com.GitHub:Felix-PedroLinkedIn:Felix
Package: chromadb-client
Chroma - the open-source embedding database.This package is for the the Python HTTP client-only library for Chroma. This client connects to the Chroma Server. If that it not what you are looking for, you might want to check out thefull library.pipinstallchromadb-client# python http-client only libraryTo connect to your server and perform operations using the client only library, you can do the following:importchromadb# Example setup of the client to connect to your chroma serverclient=chromadb.HttpClient(host="localhost",port=8000)collection=client.create_collection("all-my-documents")collection.add(documents=["This is document1","This is document2"],metadatas=[{"source":"notion"},{"source":"google-docs"}],# filter on these!ids=["doc1","doc2"],# unique for each docembeddings=[[1.2,2.1,...],[1.2,2.1,...]])results=collection.query(query_texts=["This is a query document"],n_results=2,# where={"metadata_field": "is_equal_to_this"}, # optional filter# where_document={"$contains":"search_string"}  # optional filter)LicenseApache 2.0
Package: chromadb-ops
ChromaDB Operations ToolsTiny collection of utilities to help you managed ChromaDB indices.WARNING: These tools rely on internal ChromaDB APIs and may break in the future.☠️☠️☠️ BEFORE YOU BEGIN ☠️☠️☠️Before you use these tools make sure your ChromaDB persistent dir, on which you intend to run these tools, is backed up.Installationpipinstallchromadb-opsUsageWAL CommitThis command ensures your WAL is committed to binary vector index (HNSW).chopscommit-wal/path/to/persist_dirNote: You can skip certain collections by runningchops commit-wal /path/to/persist_dir --skip <collection_name>WAL CleanupThis command cleans up the committed portion of the WAL and VACUUMs the database.chopsclean-wal/path/to/persist_dirWAL ExportThis commands exports the WAL to ajsonlfile. The command can be useful in taking backups of the WAL.chopsexport-wal/path/to/persist_dir--out/path/to/export.jsonlNote: If --out or -o is not specified the command will print the output to stdout.Full-Text Search Index RebuildThis command rebuilds the full-text search index.Note:Why is this needed? Users have reported broken FTS indices that result in a error of this
kind:no such table: embedding_fulltext_searchchopsrebuild-fts/path/to/persist_dirUsing DockerNote: You have to mount your persist directory into the container for the commands to work.Building the image:dockerbuild-tchops.WAL Commitdockerrun-it--rm-v./persist_dir:/chroma-dataghcr.io/amikos-tech/chromadb-ops/chops:latestcommit-wal/chroma-dataWAL Cleanupdockerrun-it--rm-v./persist_dir:/chroma-dataghcr.io/amikos-tech/chromadb-ops/chops:latestclean-wal/chroma-dataWAL Exportdockerrun-it--rm-v./persist_dir:/chroma-data-v./backup:/backupghcr.io/amikos-tech/chromadb-ops/chops:latestexport-wal/chroma-data--out/backup/export.jsonlFull-Text Search Index Rebuilddockerrun-it--rm-v./persist_dir:/chroma-dataghcr.io/amikos-tech/chromadb-ops/chops:latestrebuild-fts/chroma-data
Package: chromadb-semantic
ChromaDB Semantic Search🐔動機: 
. 高速語境探索資料庫，自然語言搜尋
. 將「語境探索」原本散亂的文字向量 .pt 檔案群升級為 duckdb+parquet 向量資料庫，並加入高速索引

💣地雷: 
. python 3.11無法編譯通過
. python 3.10測試成功

本專案使用 [ChromaDB](https://github.com/chroma-core/chroma) 以及 [Sentence Transformers](https://github.com/UKPLab/sentence-transformers) 來實現中文與英文的語意搜尋。請按照以下的步驟進行安裝和使用。安裝先確保您已安裝 Python 3.10。運行以下指令安裝必要的套件：python-mpipinstallchromadb-semantic使用方法將chromadb_semantic.py檔案放入你的專案資料夾中。在你的專案中引入chromadb_semantic.py並使用以下函式：create_chromadb_client()建立一個 ChromaDB 客戶端，資料會儲存在./data資料夾中。create_collection(client, collection_name)client: 需要傳入由create_chromadb_client()返回的客戶端物件。collection_name: 使用您希望建立的集合名稱。
建立一個新的語意搜尋集合。add_documents_to_collection(collection, documents, metadatas, ids)collection: 需要傳入由create_collection()返回的集合物件。documents: 文檔列表，內容可以是中英文，必須與metadatas和ids一一對應。metadatas: 元數據列表。ids: 文檔標識列表。
向集合中添加文檔。query_collection(collection, query_text, n_results)collection: 需要傳入由create_collection()返回的集合物件。query_text: 查詢語句。n_results: 從此查詢中要返回的結果數。
通過查詢語句，在集合中執行語意搜索。示例以下是一個使用chromadb_semantic.py的範例：fromchromadb_semanticimport*client=create_chromadb_client()collection_name="my_sentence_transformer_collection"collection=create_collection(client,collection_name)documents=["This is a sample document.","玉里鎮的月亮比較大顆","This is a test document."]ids=["doc1","doc2","doc3"]metadatas=[{"type":"sample"},{"type":"example"},{"type":"test"}]add_documents_to_collection(collection,documents,metadatas,ids)query_text="哪一個鄉鎮的月亮比較圓"results=query_collection(collection,query_text,n_results=2)print(f"Results for query:{query_text}")print(results)輸出示例：Results for query: 哪一個鄉鎮的月亮比較圓
{'ids': [['doc2', 'doc1']], 'embeddings': None, 'documents': [['玉里鎮的月亮比較大顆', 'This is a sample docummetadatas': [[{'type': 'example'}, {'type': 'sample'}]], 'distances': [[5.628111839294434, 43.863502502441406]]}注意：第一次創建集合和添加文檔時，嵌入運算可能需要一些時間。之後的查詢將會更快。