Giter Club home page Giter Club logo

ckpe's Introduction

打包ckpe模块whl包使用方式

  1. 获取whl包

image-20240111094925904

  1. pip安装
pip install C:\Users\Michael\Desktop\ckpe\ckpe\dist\ckpe-0.1.0-py3-none-any.whl
  1. 导包实现
from ckpe import ckpe

ckpe_obj = ckpe(model_name='微调模型路径', user_dict='字典路径')
  1. 例子
if __name__ == '__main__':
    text = 'APS理论和劳动生产率、维修成本之间的关系是什么?'
    key_phrase = ckpe_obj.extract_keyphrase(text, top_k=-1, with_weight=True)
    print(key_phrase)
5. 结果
[('维修成本', 2.8802847535928104), ('劳动生产率', 0.9178460080331394), ('理论', 0.7155251233118518), ('关系', 0.5773353009767901)]

打包ckpe模块whl包打包方式

详情:打包成whl,然后用pip进行本地安装
安装setuptools
pip install setuptools
pytorch文件tree

image-20240111100251410

创建setup.py文件
from setuptools import setup, find_packages

setup(
    name='ckpe',
    version='0.1.0',
    description='python toolkit',
    url='https://github.com/jesuswa/ckpe.git',
    author='wh-ckpe01',
    author_email='[email protected]',
    license='MIT',
    keywords='python toolkit utils',
    packages=find_packages(),  # 这会自动找到所有子包
    package_data={
        # 如果你有在任何包下的文件夹中的文件需要包含进来,可以这样指定
        '': ['*.txt', '*.json'],  # 包括所有目录下的.txt和.json文件
    },
    include_package_data=True,  # 这告诉setuptools包含那些在MANIFEST.in中指定的文件
    install_requires=[
        'pkuseg',  # 确保这是你项目需要的依赖包
    ],
    python_requires='>=3',
)
生成whl
python setup.py bdist_wheel

image-20240111100855970

调研地址:

主要是 - setup编写

如何制作并使用python发布的模块压缩包和whl包,并进行pip安装和使用教程,加上传Pypi,上传之后又如何增删whl项目_python制作发布压缩包-CSDN博客

如何制作并使用python发布的模块压缩包和whl包,并进行pip安装和使用教程_哔哩哔哩_bilibili

ckpe's People

Contributors

jesuswa avatar

Stargazers

 avatar

Watchers

 avatar

ckpe's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.