• 开源镜像
  • 开源沙龙
  • 媛宝
  • 猿帅
  • 注册
  • 登录
  • 息壤开源生活方式平台
  • 加入我们

开源日报

  • 2018年12月30日:开源日报第297期

    30 12 月, 2018
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《自动补全系统已上线 autoComplete.js》
    今日推荐英文原文:《Top 3 Best JavaScript Frameworks for 2019》

    今日推荐开源项目:《自动补全系统已上线 autoComplete.js》传送门:GitHub链接
    推荐理由:写搜索栏的时候兴许会用得上的 JS 库——它会根据你的输入给你提供一个包含可能选项的下拉菜单,这样就不需要再完全输入搜索结果就能够进行操作了。它现在还正在发展中,诸如在显示下拉菜单之后用键盘选择选项这样方便的功能暂时还没有实现,如果对它感兴趣的话可以关注一下它的发展。

    今日推荐英文原文:《Top 3 Best JavaScript Frameworks for 2019》作者:Cuelogic Technologies
    原文链接:https://medium.com/cuelogic-technologies/top-3-best-javascript-frameworks-for-2019-3e6d21eff3d0
    推荐理由:2019 前三名应该使用的 JS 框架,说到这相信有些朋友应该猜到是哪三个了

    Top 3 Best JavaScript Frameworks for 2019


    Introducing javascript frameworks


    Undoubtedly, JavaScript’s (JS) popularity in the developer community has grown exponentially over the years. The reason is its ability to allow developers to design and modify web pages in numerous ways and even add functionalities to real-time web apps. JavaScript is gathering attention not just for its simplicity and ease of use but also due to what it brings to the table — Efficiency, Security, and Low-cost results.

    At the same time, advancing technologies are pushing techies to add new skills to their repository for JS. It goes without saying that the market of JavaScript libraries/frameworks is a bit messy today. There is a lot of noise with in terms of available options and developers often need to test the waters by learning multiple libraries/frameworks to determine the best one.

    Consider the popular State of JS Survey of 2018 that gives an account of the number of libraries that developers are currently using:

    Although there are many libraries available today, survey results prove that Vue, React, and Angular continue to be the market leaders.


    1. Vue.js


    Vue became the most popular front-end GitHub project in 2018, a feat that has followed the framework in 2018 with 117k stars and more than 29k forks (at the time of writing). Created by Evan You who worked on numerous Angular.js projects during his time at Google, Vue.js is a lightweight counterpart of Angular.js and is also proving to be an attractive alternative to it.

    One of the main reasons why developers love Vue is because it is a progressive framework. This means that it elegantly adapts to the needs of the developer, starting from 3 lines to managing your entire view layer. VueJS can be quickly integrated within an app through the ‘script’ tag, where it gradually starts to explore the space.

    But Vue particularly works because it picks up the best choices and possibilities that frameworks such as Angularjs, Reactjs, and Knockout provide. This makes it the best version of all frameworks put together in a neat and tidy package that delivers.

    Let ‘take a look at the pros and cons of developing with Vue.js

    Pros of Vue.js

    • Size: This is one of the best highlights of Vue. The production ready build of Vue is surprisingly lightweight — just 18kb after zipping. This provides it with a much-needed speed and accuracy as compared to other major frameworks. At the same time, even the ecosystem around Vue is small and fast as it allows users to separate the template-to-virtual-DOM compiler as well as the run time.
    • Integration Capability: Vue offers one of the best integration capabilities since it can be used to build both single-page applications and complex web applications. Small interactive parts of the framework can be easily integrated with other frameworks/libraries such as Django, Laravel, and WordPress.
    • Scalability and Versatility: You can use Vue both as a library or as a fully-fledged framework. Vue can be easily used to develop large and reusable templates with minimal fuss, owing to its simple structure.
    • Adaptability: Most of the developers who adapt Vue switch to it from other major frameworks. The switching period often comes about to be swift because of the similarity of Vue to React and Angular.
    • Readability: Vue is quite easy to read and understand for developers since functions are highly accessible. Additionally, HTML blocks handling can be optimized with a usage of different components.

    Cons of Vue.js


    + Lack of Resources: Due to the small market share at the moment, Vue still has a long way to go. The relative age has also added to the woes around common plugins, which makes working with external tools a bit difficult.
    + Quick Evolution: While a swift development phase is good for a framework is good in terms of capabilities, the learning curve keeps on changing. As a result, online resources can end up being outdated and the documentation can sometimes be the only resource for developers.
    + Reactivity Caveats: The documentation clearly states some reactivity caveats such as directly setting an item from an array. This can either be done by using items[key]=value or adding a new data property. So, this needs to be effectively handled in the development process.

    2. React.JS


    React is another popular JavaScript library which powers Facebook. Developed and open sourced by Facebook in 2013, it quickly rose to prominence for the development of huge web applications that involve dynamic handling of data.

    In Jan 2019, Facebook extended its support to the library by moving the create-react-app (CLI tool to help create React app) from incubation to the official Facebook repository.

    One of the main cases where React finds extensive usage is when developers need to break down complex codes and reuse them in an error-free environment that has the capability to handle real-time data. Elements related to lifecycle hooks such as decorators, help to enhance the user experience.

    React makes use of virtual DOM that helps it to integrate with any application. It also adopts JSX to structure components and helps to develop more SEO friendly web pages as compared to other JS libraries/frameworks.

    To help you pick the best library/framework for your needs, let’s take a look at the pros and cons of React.js Development:

    Pros of React.js


    + Ease of Learning: React showcases simplicity in terms of its syntax that involves a lot of HTML writing skills. Unlike Angular that requires a steep learning curve of being proficient in TypeScript, React’s dependency on HTML makes it one of the easiest JavaScript libraries to pick up.
    + Library, not Framework: React is a JavaScript library instead of a framework. This means that it provides a declarative method of defining UI components. It can also be easily integrated with other libraries. For instance, the React-Redux library provides the necessary glue between React and Redux libraries.
    + Data and Presentation: React provides total separation of data and presentation layers. Though it does have the concept of ‘state’, it is best used for storage that lasts for a very short span of time.
    + DOM Binding: Developers do not have to go through the pain of binding DOM elements to functionality. React handles this by splitting the binding across multiple areas of the code with only the responsibilities.
    + Reusable Components: Facebook has developed React in a way that it provides the ability to reuse code components of any level anytime. This saves a lot of time during development. This ability mainly adds to design efficiency and makes it easy for developers to handle upgrade since any change made to one component has no effect on the other.
    + Unidirectional Data Flow: React utilizes downward data binding. This helps to make sure that any changes made to child structure do not end up affecting their parents. This makes the code more stable and all the developer needs to do to change an object is modify its state and apply updates.

    Cons of React


    + High Development Pace: The environment of React is very dynamic and keeps on changing constantly. This puts an added responsibility on developers to keep brushing up and learning new skills. This might be a headache for developers who are just starting out.
    + JSX as a Barrier: React actively makes use of JSX, which is a syntax extension that allows mixing of HTML with JavaScript. Although JSX can protect the code from injections (among other benefits), it does involve a high level of complexity and a steep learning curve.
    + SEO Issues: Users have reported issues regarding SEO since search engines poorly index dynamic web-pages with client-side rendering. Although opinions are mostly speculative, experts recommend that developers learn how the crawlers of Google and other search engines experience them.

    3. Angular.JS


    Angular is considered to be one of the most powerful open source frameworks. It is an “all-in-one” solution that aims to provide developers with every possible option out of the box. From Routing to HTTP requests handling and the adoption of TypeScript, everything has been set up.

    Although the learning curve of Angular was quite steep in earlier versions, it has smoothened out in the latest version of Angular 5 and 6. This has been made possible through a robust CLI, which has taken away the need to know the low-level details for simple apps.

    Developed and maintained by Google, Angular has followed the schedule of releasing new versions every 6 months. The latest releases have mainly focused on the addition of new features and improvement of performance.

    Here is a look at the pros and cons of Angular.JS Development:

    Pros of Angular 5


    + Documentation: Angular 5 comes with a detailed documentation. This makes it easier for new developers to pick up the framework and also understand the code of other projects as compared to earlier versions of Angular.
    + Simpler PWA: Progressive Web Applications have risen in popularity and the Angular team has been swift to integrate the capability within the framework. It is also possible with Angular 5 to get the features of native mobile applications.
    + Build Optimizer: The Build Optimizer in Angular 5 removes all the unnecessary runtime code. This makes the application lighter and faster since the size of the JavaScript in the application reduces.
    + Universal State Transfer API and DOM: Angular 5 has been introduced with Universal State Transfer API and DOM support. This helps to share the code between the server and client-side versions of the applications. This helps to improve the perceived performance of the application.
    + Router Hooks: Router cycles can now be tracked from the start of running guards till the activation has been completed.
    + Data Binding and MVVM: Angular 5 allows two-way data binding. This minimizes the risk of possible errors and enables a singular behavior of the app. On the other hand, the Model View View Model capability allows developers to work separately on the same app section with the same set of data.

    Cons of Angular 5


    + Complex Syntax: Just like the first version of Angular, Angular 5 also involves a complicated set of syntax errors. Although the silver lining is that it makes use of TypeScript 2.4, which is less difficult to learn as compared to other Angular versions.
    + Migration: Migrating the app from old versions of Angular can be an issue, especially for large-scale applications.
    + High Churn: Although Angular is quite popular in terms of usage, it is also known to clock the most level of churn. This might be due to the steeper learning curve as compared to other popular alternatives available today.

    Comparison Table — Angular 5 Vs React Vs Vue


    Here is a consolidated look at the comparison of the 3 most popular JavaScript Frameworks/Libraries of 2019 to give you a bird’s eye view of how things stand:


    Conclusion


    All 3 frameworks/libraries are quite popular today and are backed by a healthy ecosystem and team of developers. There is no right answer and it all comes down to your personal choice and programming style as each framework involves a different development philosophy. Whatever the case, React, Vue, and Angular continue to dominate the world of JavaScript.
    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 2018年12月29日:开源日报第296期

    29 12 月, 2018
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《绿色保护着我前进 atree》
    今日推荐英文原文:《Statistics for Data Scientists in 5 mins》

    今日推荐开源项目:《绿色保护着我前进 atree》传送门:GitHub链接
    推荐理由:一棵迟来的圣诞树!只要在心里给它加上装饰的确可以成为一棵圣诞树。如果有兴趣的话可以看看作者提供的代码,兴许可以在农历新年里自己也实现一个。虽然有点迟了狂欢夜都过了,不过不管怎么说,圣诞快乐!

    今日推荐英文原文:《Statistics for Data Scientists in 5 mins》作者:Diva Jain
    原文链接:https://towardsdatascience.com/statistics-for-data-scientists-f2456d26c5a5
    推荐理由:猴子也看不懂的关于数据统计方面的一些知识,在以后分析数据的时候可能用得上

    Statistics for Data Scientists in 5 mins

    “Facts are stubborn things, but statistics are pliable.”― Mark Twain Photo by Mike Kononov on Unsplash

    Population parameter vs. Sample Statistics



    The goal of the researcher is not to draw conclusions about the sample but to draw conclusions about the population from the provided sample. Thus researchers must use statistics on the sample to infer about the values in the population. These values in the population are called parameters. Parameters are the unknown characteristics of the entire population, like the population mean and median. Sample statistics describe the characteristics of a fraction of population which, is taken as the sample. The sample mean and median is fixed and known.

    Sampling Error


    Suppose, I have 3000 people who go for a morning walk in a park. I can get their average weight and population mean, which is an exact representation of the average height. In practice, calculating true mean is not viable every time. Therefore, we will take a portion of the total population of 3000, i. e., 1000. If the sample is chosen at random rather than observed, then the expected mean is similar to the true mean. However, as it is a random sample, the mean could vary from true mean. The difference between the sample mean and the true meaning is known as sampling error.

    Standard Error


    It refers to the standard deviation of all the means. It shows how much the values of the mean of a bunch of samples differ from one another.

    Suppose, we want to observe how much sale occurs in 3 days. By taking means of sales each day, we can get the average sales. However, there are many external factors that influence sales, like, discounts, holidays, etc. Thus, instead of taking the mean of one day, we take means of 3 days.

    The Standard Error of the means now refers to the change in the mean with different observation each time.

    If we measure multiple samples of a dataset, means won’t be same and will spread. SE of samples is the standard deviation of the sample means and gives us a measure of the spread.

    Confidence Interval & Confidence Level


    “According to a survey, the oranges in the orchard with a 96% level of confidence weighs between (132–139 gm)”.

    (132–139 gm) is the confidence interval. It is a range of values within which the true value lies. CI is used to express the range in which we are sure the population parameter lies. Whenever we want to express an estimate of a population parameter, it is a good practice to state its CI. The width of CI tells us a lot about certainty we have about the population from the collected sample. When you don’t know much about the population’s behaviour, you need to use t-distribution to find the Confidence Interval.

    96% confidence level means that if the survey or polls were to be repeated with the same conditions, over and over again, the results of the survey would match the results from the actual population 96% of the time.
    Two things which affect CI is Variation and Sample Size:-
    Variation: If all the values in the population were similar, then the sample would have little variation. Every sample of the population would be similar to each other.
    Low Variation causing Similar Samples causing Narrow CI
    High Variation causing Varied Samples causing Wider CI

    Sample Size: If we take small samples, we don’t have many findings to base our inference upon. Small samples will differ from one another, and have less detail, leading to wider CI
    Large sample size causing more details causing Narrow CI
    Small sample size causing fewer details causing Wider CI

    Margin of Error


    Surveys are based on facts collected from a sample, not the entire population. Some amount of error is bound to occur as we have to infer real statistics based on samples, like sampling error, which occurs because everyone isn’t taken into account. The margin of error is supposed to measure the maximum amount by which the sample results are expected to differ from those of the actual population. It measures accuracy, not the amount of bias.
    margin of error = critical value * standard error

    Example: We know 49% will vote for Mrs Dix in the elections, with a margin of confidence +/-2. This means I am confident that between 47%(49%-2%) and 51%(49%+2%) of the population will vote for her.

    Hypothesis Test


    The main purpose is to test the results of surveys and polls to check if the results were meaningful and repeatable and not random. It is whether we can accept or reject a claim using statistics. It examines two claims about the population. Example: The drug for a headache will not be effective, or will the height of female and male students differ? Generally, the statement is in the form of “If (do this to an independent variable), then(this will happen to the dependent variable)”.

    Null and Alternative Hypothesis


    The null hypothesis (H0), is usually the hypothesis that sample observations result purely from chance. It is the fact that is commonly known. Researchers work to reject it. The idea is that there is no relationship and whatever is being reflected in the result of sampling error. It proposes that no statistical significance exists in a set of given observations.

    The alternative hypothesis (H1 or Ha), is the hypothesis that sample observations are influenced by some non-random cause. The idea is that the relationship in the sample reflects the relationship in the population. Example:
    H0: Earth is flat. There exists a relationship between the population and Ha.
    Alternate Hypothesis: Earth is round

    Type I and Type II Error


    Type I Error means rejecting the True null hypothesis and accepting the alternate hypothesis. It is a false positive. A smoke detector detecting smoke when there is no smoke.
    Type II Error means accepting the null hypothesis when an alternate hypothesis is true. It is a false negative. When fire alarm fails to detect fire.

    Alpha and Beta Level


    z indicates the alpha level in a two-tailed test

    Alpha level is also known as the significance level, α. It is the probability of making the wrong decision,i.e., rejecting the null hypothesis when it is true. Low alpha levels mean that we need strong evidence to be able to reject the null hypothesis. This means that alpha level of 1% requires more statistical evidence than 5%.

    Why is 5% used as significance level so commonly?

    The smaller the alpha level, the little is the chance to reject True Null hypothesis. And, also the smaller is the chance to reject the False null hypothesis, because of the tiny area. The more you try to avoid Type I Error, the more you are likely to make a Type II Error.

    A confidence level is 1- α, which means accepting the null hypothesis when it is True.

    Beta level means the probability of making a Type II Error, i.e., rejecting the Alternate hypothesis when it is True.

    P-Value


    It is used by all the hypothesis testing to check the strength of the evidence provided by the population in form of data. It is the evidence against the null hypothesis. The value is between 0 and 1:

    A small p-value ( ≤ 0.05) indicates strong evidence against the null hypothesis, so you reject the null hypothesis. It means that the sample results aren’t consistent with the null hypothesis that is true.

    A large p-value (> 0.05) indicates weak evidence against the null hypothesis, therefore you fail to reject the null hypothesis. It means that the sample results are consistent with a null hypothesis that is true.

    If the p-value is less than or equal to the alpha level, we reject the null hypothesis.
    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 2018年12月28日:开源日报第295期

    28 12 月, 2018
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《代码风格转换 prettier》
    今日推荐英文原文:《Mapping Mars with AI》

    今日推荐开源项目:《代码风格转换 prettier》传送门:GitHub链接
    推荐理由:每个人写代码的风格都不一样,即使想办法统一了变量名函数名这些起名字的风格,代码的风格依旧会有所差异。但是现在可以试着改变这个情况了,这个项目能够格式化代码让它们具有一个比较容易阅读的风格,相信对于团队合作项目来说统一风格会相当管用。它不仅是通过换行来提高可读性,而且可以通过一些选项来改变细节部分——比如用制表符来进行缩进而不是空格,如果你的团队正困扰于代码风格的不同,这个项目会派上用场。
    今日推荐英文原文:《Mapping Mars with AI》作者:Mark Wronkiewicz
    原文链接:https://medium.com/devseed/mapping-mars-with-ai-590ec1c9cb11
    推荐理由:靠着 AI 给火星画地图这事估计还是第一次有人干

    Mapping Mars with AI

    A pipeline to fully map the Red Planet


    This blog post coincides with research that we’re presenting at the American Geophysical Union Conference on Dec 13th, 2018.

    The exploration of Mars will require precise maps. Current feature maps for Mars are created by hand and therefore only include large features. Collaborating with researchers at Arizona State University, we used the YOLO deep learning architecture to autonomously detect surface features (here, craters) faster and at much finer scales. With assistance from Artificial Intelligence (AI), we can bring down the planet-wide mapping process from years to weeks.

    Motivation


    For much of history, explorers left home not knowing what they would encounter. Maps were so rare and valuable that explorers would employ spies to steal this geospatial information from rival nations. The first humans that venture to Mars will face ever-present hazards threatening their survival. We have the tools to make sure that the lack of an accurate map isn’t one of them.

    Many surface features (e.g., craters, dunes, gullies, recurring slope lineae, etc.) are important to map for human and scientific exploration. We are working with ASU-based Mars experts Hannah Kerner and Tanya Harrison to build a machine learning pipeline that can detect these features on a planetary scale. Our initial results suggest that by using this pipeline, we can reduce the time and cost of mapping Martian surface features by several orders of magnitude.

    Current approach


    The current best crater map was created by hand and only includes craters with diameters ≥ 1 km. The planet-wide Robbins Crater Database (built using THEMIS daytime imagery at 100 m/pixel) contains 384,343 craters (Robbins and Hynek, 2012) and took about 4 years to complete. This crater map was a major contribution to the scientific community, but Mars is a dynamic planet and our maps need to be dynamic as well. By the time a multi-year mapping effort is completed, it’s in danger of being out of date.

    Human mapping at this scale is also prone to limitations. First, the manual mapping process doesn’t scale well — crater count increases approximately exponentially with decreasing crater diameter (Robbins and Hynek, 2012). Second, existing mapping efforts are difficult to replicate as human mappers are unlikely to generate the same crater map twice. For craters that are significantly eroded or obscured, it’s hard to quantitatively instruct a person to be more or less conservative when mapping. Finally, craters are only one of many interesting surface features. It’s impractical to repeat the planet-wide mapping process by hand every time we need to map a new feature. We can mitigate these problems using state of the art methods from AI.

    AI-based mapping


    Deep learning — a popular subfield within AI — is a technique that can discern complex patterns in data. We developed an approach to map craters at sizes down to 100 meters in diameter using a deep learning model. While we focused specifically on detecting craters here, the same architecture we chose can be extended to map multiple categories of surface features, such as dunes or gullies.

    Example bounding box visualizations of detected craters. The YOLO model provides the center coordinates, width, and height of all craters it detects. We can estimate the diameter of these craters by averaging the width and height of each bounding box.

    The specific architecture we selected is called You Only Look Once (YOLO; Redmon and Farhadi, 2018). YOLO is an open source object detection algorithm that predicts bounding boxes around objects of interest. We trained the model to analyze satellite images and generate bounding boxes around detected craters. The satellite images of Mars were taken by the ConText Camera (CTX) imager on the Mars Reconnaissance Orbiter (MRO) and the images are publicly available on NASA’s Planetary Data System (PDS).

    Data flow through the processing pipeline from input data, through prediction, to output bounding boxes. Left: Context images are sliced into overlapping 512×512-pixel tiles. Windows span multiple spatial resolutions so that both large and small craters are detectable. Right: The YOLO model takes the windowed tiles as input and proposes bounding boxes (defined by x, y position, width, height, and prediction confidence). In training, where the ground-truth bounding boxes are known, prediction errors are back-propagated through the network to tune the model. During prediction, we can vary the confidence threshold to tune how conservative the model’s predictions should be.

    Results


    Once the model was trained, we generated a crater map for several of the Mars 2020 rover candidate landing sites (NE Syrtis, Jezero, and Midway) as well as the area around the Curiosity rover (Gale Crater). Detailed information and imagery from the landing sites is available from the Murray Laboratory at Caltech.

    Crater map relevant for the Mars 2020 rover mission. The blue ellipses are two candidate landing zones for the upcoming Mars 2020 rover launch and green boxes represent detected craters. The Jezero landing site (right ellipse in this animation) was chosen in November 2018 after a thorough selection process.

    Craters mapped near the Jezero landing site within Jezero Crater. Evidence of a long dried up river delta lies just Northwest of the Jezero landing ellipse. The Mars 2020 rover will take soil samples in this area and search for signs of past microbial life.

    In these target regions, we identified a total of 381,648 craters with diameters down to 100 m at a processing speed of approximately 20 km² per second. We ran the model on a single GPU cloud machine and achieved a maximum F1-score of 0.87, which is reasonably good performance for an object detection model. While the Robbin’s Database has many additional crater details (ejecta, depth, morphology, etc.), that’s a 10x improvement on crater resolution at a speed roughly 5 orders of magnitude faster.

    Humans and robots mapping together



    Curiosity rover and craters in Gale Crater. Detected craters are indicated by green boxes and the rover icon indicates Curiosity’s position in December 2018. Note that the actual rover is not visible in any of the CTX images as it is smaller than a single pixel.

    While AI can help us map at the planetary scale, these techniques have some limitations. For example, our model misses some craters and falsely categorizes other circular features as craters. The best strategy will likely need to combine the speed of AI-based tools with the accuracy and flexibility of expert human mappers. Basically, we can use AI to propose a planet-wide surface feature map and then rely on humans to validate the predictions. We hope to give planetary researchers the ability to spend more time on mission planning and scientific analysis.

    In the near future, we plan to bring expert validation into this pipeline so we can import these crater maps into the public Java Mission-planning and Analysis for Remote Sensing (JMARS) platform used by Mars mission planners and researchers. Our long term vision is an open and interactive map (à la OpenStreetMap) that explorers, scientists, and the general public can all use to better understand the surface of Mars.
    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
  • 2018年12月27日:开源日报第294期

    27 12 月, 2018
    开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
    今日推荐开源项目:《像素艺术 awesome-pixel-art》
    今日推荐英文原文:《How chatbots work and why you should care》

    今日推荐开源项目:《像素艺术 awesome-pixel-art》传送门:GitHub链接
    推荐理由:喜欢像素艺术的同学应该会对这个项目很感兴趣,这个项目收录了关于像素艺术的各种内容,包括教程,游戏和编辑器等等,你也可以在这个项目中了解到一些与像素艺术有关的艺术家。实际上兴许玩过 minecraft 的朋友都知道了,像素艺术是指与像素有关的艺术——举个最简单的例子就是像素画,这算是常见的一种形式了,像素画比起普通的画来说感觉又会有所不同,有兴趣的话可以用编辑器去试一试。
    今日推荐英文原文:《How chatbots work and why you should care》作者:boost.ai
    原文链接:https://medium.com/boost-ai/how-chatbots-work-and-why-you-should-care-bd2fa3aef4a4
    推荐理由:顾名思义,这篇文章的是关于聊天机器人的——构建它们所需要的一些条件,或者说一些需要达成的目标

    How chatbots work and why you should care

    Chatbots, virtual assistants and digital advisors — or whatever you choose to call them — are built to serve the same purpose, but they have to be built with the proper components to successfully deliver lasting business value.

    Written by: Abhishek Thakur, Chief Data Scientist, boost.ai

    It’s becoming increasingly common to find chatbots, virtual assistants and digital advisors taking pride and place over email and phone as a primary method of contact for customers seeking to interact with companies. Many people prefer to use live chat over wading through a website’s confusing FAQs or stunted search functionality, and it’s easy to understand why. Chatting with a robot can quickly and consistently answer customer queries, reducing congestion and freeing up support staff to focus on more pressing tasks.

    But the underlying principles of building conversational AI that’s advanced enough to provide actual business value aren’t as simple as the automated, fully-functioning, customer-facing company representative might make it seem. The methods we’ll discuss below are but a few of the prerequisites to successfully deliver a solution far beyond what a simple rule-based chatbot can achieve.

    Basic building blocks

    Artificial Intelligence Markup Language (AIML) is an XML dialect used to create natural language for virtual assistants. AIML uses a set of rules to define a pattern, whereby if an end-user’s message adheres to said pattern, a rule-based chatbot can elicit a predefined response.

    In Figure 1(a), the pattern is defined as ‘HELLO’ and, when triggered by the user, the chatbot replies with the template response ‘Well, hello!’.

    Another method for providing a variety of replies to a pattern is through the use of wildcards. These allow for a pattern to be matched, while delivering a seemingly random response from the chatbot.

    As evidenced in Figure 1(b), if a user initiates the pattern ‘ONE TIME I ’ by typing in that particular phrase (plus an ensuing qualifier), the chatbot will revert with one of the preset responses at random.

    Rule-based chatbots can only serve replies by finding either exact or pattern-based matches for keywords. They are unable to determine how words are connected to each other, let alone the actual meanings of the words themselves.

    In the era of artificial intelligence, rule-based chatbots are inadequate at getting the job done efficiently. They may occasionally serve a purpose (in the way that a stopped clock is right twice a day) but ultimately fall short of being truly useful.

    To overcome the difficulties of understanding what an end-user actually means, especially if their request is written in a complicated manner, we have to instead look towards artificial intelligence to help solve these problems. At boost.ai, we eschew the use of AIML in favor of deep learning in order to build conversational AI, which is far more advanced than ordinary chatbots.

    One million layers

    There are a number of simple ways that we can make rule-based chatbots more intelligent, including using word embeddings such as Word2vec, GloVe or fastText, amongst others.

    Word embeddings create a vector of 1xN dimensions for each word in a given corpus by using a shallow neural network. While we’ll have to save the particularities of how these vectors are created for another article, it’s important to note, however, that since these embeddings look at how words are used — and what their neighboring words are — they are therefore able to understand the actual meaning of individual words.

    Figure 2(a) represents the vectors for Berlin, Germany, Oslo and Norway across two dimensions. To decompose and represent word vectors in two dimensions, one can use t-Distributed Stochastic Neighbor Embedding (t-SNE) which is a dimensionality reduction technique.

    If we subtract the vector for Germany from Berlin and add the vector for Norway, we will get a vector which is very close to the original vector for Oslo.

    The word vectors or embeddings can therefore be used to determine the closest words and, using Fasttext techniques, we are also able to derive a vector for word that is not present in the corpus.

    Using vectors for words, allow us to build a simple weighted average vector for sentences. Figure 2(c) is a clear example of Python snippet on how to do just that.

    Once we have established the vector for the whole sentence, a simple distance metric — such as cosine distance — can be used to find the nearest matching answer for the user’s query, as Figure 2(d) accurately depicts.

    Conversational AI does not consist of a single learning artificial intelligence. It’s built from a variety of composite parts that make up the greater whole.

    The following four major steps make up the core of an intent-based virtual assistant, with text processing and intent prediction being the most crucial.

    An virtual assistant has to contend with a high volume of text-based messages, hence a number of text-processing steps are key to how accurate its responses are. It simply isn’t enough to rely on deep learning models to provide results, as these models will only perform as well as the data given to them.

    When drilling down into the Natural Language Processing (NLP) and Natural Language Understanding (NLU) in conversational AI, the following components are the most important: 1. Language detection 2. Clean up 3. Tokenization 4. Stemming 5. Synonyms & stop words 6. Spell correction 7. Compound splitting 8. Entity recognition Using these, an intent-based virtual assistant should be able to achieve the optimal outcome described in Figure 2(f), with each and every step being crucial to how a VA responds to a message.

    There are two options when approaching language detection: either use off-the-shelf libraries such as Langid or fastText, or you can simply build your own. If you decide to go with the latter you can either use a Wikipedia dump for several languages, train a basic TFIDF-Logistic Regression model, or opt for a neural network.

    Let’s say we have Wikipedia data for four languages: English, Norwegian, French and German.

    This data can be used with a pipeline consisting of TFIDF and Logistic Regression.

    The method depicted in Figure 3(b) should provide good results. Alternatively, you could use a simple LSTM-based neural network to achieve the same results.

    Clean up
    Cleaning up text data in a sentence is a very important task, but it can also be difficult and tiresome.

    Figure 3(c) illustrates three simple cleanup techniques for how this can be tackled.

    It is possible to:

    1) replace special characters

    2) use a regular expression

    3) filter all alphanumeric characters in the sentence

    We can mix and match, or try all three of these methods together in order to achieve an optimal result.

    Tokenization

    The Tokenization step can be applied either before or after clean up. It splits a desired sentence into separate parts called ‘tokens’. While it is commonly believed that Tokenization is principally about separating words by spaces, it is actually language dependant and may require the need to write customized tokenizers if the ones freely-available are not fit for purpose.

    Figure 4(a) is an example of how to do Tokenization in Python using the NLTK library.

    Stemming

    The stemming step is designed to reduce the target word to its base form.

    In Figure 4(b), we can see all forms of the word ‘fish’ reduced to a single root word. Rather than confusing a machine learning algorithm with hundreds of variations of a root word, stemming and lemmatization make it easier for an algorithm to understand the root, thus providing optimal results.

    Using NLTK, stemming can easily be achieved with the three lines of code illustrated in Figure 4(c).

    Understanding a single language is a relatively simple task. When dealing with multiple languages, however, things get more complex. We can use synonyms from different languages to achieve the same result.

    In Figure 5, we see how the conversational AI understands the word ‘insurance’ having been trained with the corresponding word in five different languages. Through this method, it is capable of learning and understanding a higher number of languages than its human counterpart — and way faster too.

    Spelling Correction

    Dealing with spelling errors is part and parcel of any self-respecting conversational AI. Humans are prone to typos (and we can be guilty, at times, of wanton uses of abbreviation), so we need a strong spelling correction algorithm in place to help sift through the noise of misspelled words.

    In order to build a deep learning-based spelling correction model, the following three steps should be adhered to:

    1. Gather text data from a reliable source (e.g. English Wikipedia Corpus)
    2. Introduce artificial impurities
    3. Build a stacked recurrent neural network to distinguish the original sentence from other, impure sentences

    Figure 6 is an example of how a VA can use spelling correction to extract the data it needs from any number of misspelled inputs.

    Peter Norvig, a director of research at Google, has a fascinating write-up on what goes into writing a spelling corrector that is a good jumping on point for further reading.

    Compound splitting

    Many European languages have a habit of combining words, which can prove to be tricky for computers to parse. We can use algorithms to help with this, splitting the compound words into smaller parts.

    In Figure 7(a), the Norwegian words for ‘car’ and ‘insurance’ are combined to form a single word representing car insurance.

    Similarly in German, the word for refrigerator (translated directly as ‘cold cabinet’) is also a single word, as illustrated in Figure 7(b).

    We can also treat cases where a user does not correctly use spaces to separate words in a sentence as compound words, such as in Figure 7(c).

    Compound splitting is a crucial and complex challenge that requires thinking about dynamic programming to help reach a worthwhile solution.

    Entity recognition

    The ability to correctly recognize entities and extract them is a key feature that many lesser solutions fall prey to. Good entity recognition can be achieved in a variety of ways and becomes increasingly important as the conversational AI must understand and extract the pertinent information from within text input by the user.

    It can be as simple as extracting ‘to’ and ‘from’ entities using a basic expression:

    Or, building a deep neural network with large amounts of data to tag different words in a sentence:

    In Figure 8(b), the sentences at the top are the training data. The locations are tagged as ‘1’, while the other words in the sentence bare a tag of ‘0’. If a user inputs a new sentence, e.g ‘Things to do in Berlin’, the network displayed above will be able to correctly identify ‘Berlin’ as a location, providing the appropriate amount of training data has been supplied.

    Data and the model

    When everything related to text-processing is in place, we can then begin to build an intent classification model. Figure 9(a) illustrates an example of how the data for that model could look like:

    For each intent listed in Figure 9(b) (e.g. insurance, car insurance, funds etc.) there is an amount of corresponding training data associated with it. We can apply the same text processing methods discussed previously to the training data and then send it to a deep neural network.

    When the user inputs a new sentence, text-processing methods are applied as before and, if everything runs smoothly, the correct intent is predicted by the network and a dynamic response is generated which can then be sent to the end-user.

    A good example of this is Figure 9(c) which illustrates a complicated case from one of our live clients.

    In this example from a Norwegian bank, the primary language is (obviously) Norwegian, whereas the end-user wrote their question in English. Regardless of the input language, Banki, their digital banking advisor, is able to accurately understand the question and serve the correct response, despite different languages and spelling and formatting errors.

    With the correct components and training, conversational AI has the capacity to break language barriers, assist end-users, automate processes and digitize customer interaction to a far greater extent than its human counterparts.

    下载开源日报APP:https://opensourcedaily.org/2579/
    加入我们:https://opensourcedaily.org/about/join/
    关注我们:https://opensourcedaily.org/about/love/
←上一页
1 … 185 186 187 188 189 … 262
下一页→

Proudly powered by WordPress